Incorrect syntax near 'int'

D

David

I am using VS2005 and .Net 2.0 with a DetailsView control tied to an
SqlDataSource. I get the above error when I click the Update link button on
the control. I cannot see where this "int" is anywhere in my UpdateCommand
string. How can I debug this error? Thanks.

David
 
O

OHM \( One Handed Man \)

post your sql statement. Not a calculated one, the one at the point at which
it will be used, so use debug to stop it before you issue and execute
command or whatever.
 
S

sirfunusa

Run SQL Profiler to see the actual SQL syntax being sent (assuming SQL
Server)
 
J

Juan T. Llibre

Or, simply, do a response.write which outputs the SQL statement to the page.

It's amazing the errors you can catch by doing that.
 
S

sirfunusa

Except if you due pure databinding in VB.NET, the raw SQL statement is
not available.
 
J

Juan T. Llibre

So, how does it get called ? By osmosis ?

The SQL statement has to reside somewhere.
It can be retrieved from wherever that somewhere is, then.
 
S

sirfunusa

I stand corrected. For some reason (lack of sleep?), I had thought the
code was hidden in VB.NET. It's in the collapsed #Region " Web Form
Designer Generated Code "
 
D

David

Below is what I have in the UpdateCommand string of the SqlDataSource used
in the DetailsView control that I am using:

UPDATE [File_Mst] SET [Firm] = @Firm, [Open Date] = @OpenDate, [Close Date]
= @CloseDate, [Box Num] = @BoxNum, [Destruction] = @Destruction, [LitRpt] =
@LitRpt, [QtrRpt] = @QtrRpt, [CorpFile] = @CorpFile, [OffBoxNum] =
@OffBoxNum, [OffOpenDate] = @OffOpenDate, [OffCloseDate] = @OffCloseDate,
[OffDestruction] = @OffDestruction, [OffDestroyed] = @OffDestroyed,
[Destroyed] = @Destroyed, [Relocated] = @Relocated, [Verified] = @Verified,
[Electronic] = @Electronic, [CheckedOut] = @CheckedOut, [CheckedOutDate] =
@CheckedOutDate WHERE [File Number] = @File_Number

Does this help?

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top