473,795 Members | 2,911 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Incorrect syntax near 'int'

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
Apr 6 '06 #1
7 2220
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.

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net
"David" <dl*****@lifeti meinc.com> wrote in message
news:e5******** ******@TK2MSFTN GP03.phx.gbl...
I am using VS2005 and .Net 2.0 with a DetailsView control tied to an
SqlDataSourc e. 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
UpdateComman d string. How can I debug this error? Thanks.

David

Apr 6 '06 #2
Run SQL Profiler to see the actual SQL syntax being sent (assuming SQL
Server)

Apr 6 '06 #3
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.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"sirfunusa" <si*******@hotm ail.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
Run SQL Profiler to see the actual SQL syntax being sent (assuming SQL
Server)

Apr 6 '06 #4
Except if you due pure databinding in VB.NET, the raw SQL statement is
not available.

Apr 7 '06 #5
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.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
"sirfunusa" <si*******@hotm ail.com> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
Except if you due pure databinding in VB.NET,
the raw SQL statement is not available.

Apr 7 '06 #6
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 "

Apr 7 '06 #7
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

"David" <dl*****@lifeti meinc.com> wrote in message
news:e5******** ******@TK2MSFTN GP03.phx.gbl...
I am using VS2005 and .Net 2.0 with a DetailsView control tied to an
SqlDataSourc e. 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
UpdateComman d string. How can I debug this error? Thanks.

David

Apr 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
45080
by: J. Muenchbourg | last post by:
IN the code below, I am getting an Incorrect Syntax near "," error (the sql execute line, and it is pointing to position 1 ) (the display formatting here may look different than my script): strSQLStatement = "INSERT INTO tblArticles(handid,articleid,articleDate,sport,articleheader,fpick,artic leText)"_ & "VALUES ('" & handid & "', " _ & articleid & ", '" _ & articledate & "', " _
1
9910
by: Amit D.Shinde | last post by:
Hi Experts, i am writting a stored procedure in sql server 7. Its a simple stored procedure It is my first stored procedure. I want insert a record in table if the primary key field user id already does not exists. if it exists SP should pass 0 as output else if insert is successfull it should pass 1 to calling sp. But following SP raising an ERRor" Incorrect Syntax near 'GO' help
1
14195
by: Jeff Magouirk | last post by:
Dear Group, I am trying to create a view and keep getting the Incorrect syntax near the keyword 'Declare'" error. Here is the code I am writing. Create view fixed_airs (sid, fad_a2, fad_a3) as Declare @sid int, @fad_a2 int,
3
6173
by: teddysnips | last post by:
In the script below is the DDL to create some tables and a UDF. What I'm interested in is the UDF at the end. Specifically, these few lines: --CLOSE OTRate --DEALLOCATE OTRate ELSE -- @NumRecords <= 0 If I uncommment CLOSE and DEALLOCATE and check the syntax I get a
1
11255
by: Sandesh | last post by:
Hello All, Me saying " has any body come across such error would be underestimating". Well I am getting a very peculiar and unique error "Line 1: Incorrect syntax near 'Actions'." Explaining you the scene is the following Stored Proc.
1
2356
by: iporter | last post by:
In the following code, the two Response.Write statements output exactly the same - I can copy and paste both into Query Analyzer, and run them fine. However, if I comment out line 3, the assignment of "SELECT T..." to the variable query, the last line produces the error: Line 1: Incorrect syntax near '<'. Many thanks in advance for any explanation - the problem is tearing my hair out!! Iain
0
8332
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically generated.Iam not able fix the error. Iam working with Visual Web Developer-2005 Express Edition
10
3429
by: arial | last post by:
Hi, I am getting this error message: Incorrect syntax near the keyword 'where'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'where'. Source Error:
5
4497
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, What is wrong with this code ? I got this error: " Line 1: Incorrect syntax near 'sp_Collect'. " which appears at the last line when | call the cm.ExecuteScalar . The sp takes an int ID and returns a string Data. Using the debugger, I see that the value of ID is correct. Is this a C# problem, or SQL Server 7 problem ?
1
6271
by: karenkksh | last post by:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'user'. Source Error: Line 35: MyAdapter1 = new SqlDataAdapter(MyCommand1); Line 36: MyDataSet1 = new DataSet(); Line 37: ...
0
10439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7541
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.