Wierd Linqpad Update Behavior |
Wierd Linqpad Update Behavior |
Apr 11 2008, 12:53 PM
Post
#1
|
|
|
|
I am working on finalizing an implementation to support functionality simliar to: http://weblogs.asp.net/jeffreyzhao/archive...expression.aspx
I have the following LINQPad select statement: CODE var posts = from p in be_Posts where p.PostID == new Guid( "fb68266f-3ed6-4572-956b-8c2c54a30928" ) select p; When I run an update batch statement (don't worry I plan on blogging about this whole thing once I've ironed out everything), essentially the SQL command text to run will be: CODE UPDATE [be_Posts] SET [Author] = @Author0 FROM [be_Posts] AS j0 INNER JOIN ( SELECT [t0].[PostID] FROM [be_Posts] AS [t0] WHERE [t0].[PostID] = @p0 ) AS j1 ON (j0.[PostID] = j1.[PostID]) -- @p0: Input UniqueIdentifier (Size = 0; Prec = 0; Scale = 0) [fb68266f-3ed6-4572-956b-8c2c54a30928] -- @Author0: Input NVarChar (Size = 8; Prec = 0; Scale = 0) [Ann Aney] -- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.21022.8 Now, if I take that *exact* SQL to QueryEx or SQL Management Studio, it runs fine, but LINQPad returns an error of: SqlException: Must declare the scalar variable "@Author0". Incorrect syntax near the keyword 'AS'. LINQPad obviously display more information I can append if needed, but that is a start. Any ideas to why it wouldn't work only in LINQPad (admittedly I've yet to write a little test app to test it in stand alone C# application). |
|
|
|
Terry Aney Wierd Linqpad Update Behavior Apr 11 2008, 12:53 PM
Terry Aney I 'mis-titled' this post. Sorry, dont... Apr 11 2008, 12:56 PM
Joseph Albahari Hi Terry
Maybe I'm missing something, but I d... Apr 11 2008, 05:02 PM
Terry Aney Well you are right. I made the assumption you... Apr 11 2008, 07:45 PM
Joseph Albahari QUOTE (Terry Aney @ Apr 12 2008, 11:45 AM... Apr 12 2008, 04:31 AM
Terry Aney Joe,
Here is the article: http://www.aneyfamily.c... Apr 14 2008, 12:33 AM
Joseph Albahari QUOTE (Terry Aney @ Apr 14 2008, 04:33 PM... Apr 16 2008, 06:10 PM
Terry Aney Thanks Joe. Couple things. First, is it worth yo... Apr 20 2008, 07:38 PM
Sarah Kim Hi Terry,
I updated the topic title as you sugges... Apr 24 2008, 06:44 PM
Terry Aney QUOTE (Sarah Kim @ Apr 24 2008, 09:44 PM)... May 4 2008, 10:20 PM![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 04:28 PM |