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:
-
-
-
Line 51: Qcheckdata.SelectCommand.CommandText = "where [id] = '9102806883277882981'";
-
Line 52:
-
Line 53: Qcheckdata.Fill(dsQuick1);
-
Line 54:
-
Line 55:
-
-
-
Source File: d:\devsite\tap\checkoutform\qcheck.aspx.cs Line: 53
-
-
Stack Trace:
-
-
-
-
-
-
and this is what I have in my code. -
Qcheckdata.SelectCommand.CommandText = "where [id] = '9102806883277882981'";
-
-
Qcheckdata.Fill(dsQuick1);
-
-
-
can any one help me please?
I don't know why I am getting this error message.
Thank You,
10 3377
for starters.
a sql command is generally of the format - select fieldName from table
a where clause is put after the sql statement. - select fieldName from table where [id] = 1234567
1. I dont see any select query...and the database has no source to select table, fields.
2. is id a varchar field or a numeric field?
if it is a numeric field , get rid of the single quotes around the number as that will throw an error. single quotes define strings.
Thanks Shashi.
That helped.
but I did not do that way because I had my database and table mapped to the sqldataadpter so i thought i don't need to specify that.
Thank You,
Oh got into another problem.
I change my query string to: -
string getqis = str.ToString();
-
Qcheckdata.SelectCommand.CommandText = " select * from Pass_Insp where [id] = 'getqid'";
-
it doesn't give me any result and don't know why?
Thanks,
Oh got into another problem.
I change my query string to: -
string getqis = str.ToString();
-
Qcheckdata.SelectCommand.CommandText = " select * from Pass_Insp where [id] = 'getqid'";
-
it doesn't give me any result and don't know why?
Thanks,
did you want to do this? -
string getqis = str.ToString();
-
Qcheckdata.SelectCommand.CommandText = " select * from Pass_Insp where [id] = '"+getqis+"'";
-
Thanks a million Shashi.
Also, if you know something on this.
What I need now is to send my ID to another project to pull up a different report.
both my project is under same root direcotry and are .net website.
Root: 1) Proj1
2) Proj2
how can i accomplish this?
Any help would be appreciated.
You may either refrence project 1 in project2 and use the same session class being shared.
Or you could sent the request as a query string as in http://yourwebsite.com/yourpage.aspx?report=ppp
where pp is the query param value.
but i am not sure if the security will have to be compromised for this
Good practice is you have to use LIKE keyword for string in where clause.
(I think this should be move to Sqlserver form!)
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:
-
-
-
Line 51: Qcheckdata.SelectCommand.CommandText = "where [id] = '9102806883277882981'";
-
Line 52:
-
Line 53: Qcheckdata.Fill(dsQuick1);
-
Line 54:
-
Line 55:
-
-
-
Source File: d:\devsite\tap\checkoutform\qcheck.aspx.cs Line: 53
-
-
Stack Trace:
-
-
-
-
-
-
and this is what I have in my code. -
Qcheckdata.SelectCommand.CommandText = "where [id] = '9102806883277882981'";
-
-
Qcheckdata.Fill(dsQuick1);
-
-
-
can any one help me please?
I don't know why I am getting this error message.
Thank You,
'----------------------------------------------------------
hello :-)
try to complete your statement..... are you using select statement?
or change you field name, instead of id, try different name like EmpID for employee ID...
hope this can help with your problem....
:-)
This is one more good point.
Do not use Sql Keywords like
Id
Description
Date
Like
Where
Name
group
….
…..
….
Etc…,
Thank you so much all for your suggestion.
Sign in to post your reply or Sign up for a free account.
Similar topics
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)...
|
by: Mark Findlay |
last post by:
Hello Experts!
I am attempting to use the OleDbCommand.ExecuteScaler() function within my
ASP.NET C# web page to perform a simple validation, but receive the
following error:
"Incorrect...
|
by: ielmrani via SQLMonster.com |
last post by:
Hi Everyone,
I really tried to not post this question but I gave up. I tried brackets,
parenth...etc but nothing worked. I get this error message: Incorrect syntax
near the keyword 'THEN'. ...
|
by: netone |
last post by:
I am developing site using dot NET....
when I use this sql query
Dim mydata As String = "SELECT director.applno, district.distName, disabappl.recvddate_sdo, disabappissue.IDCardNo,...
|
by: wallic |
last post by:
Hello,
This is my first post and I am a beginner with SQL code. The code below is supposed to update a new table (loctable) with a calculated value based on the original table (hra_data). ...
|
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...
|
by: itamar82 |
last post by:
I am getting the following error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near the keyword 'WHERE'.
for the sql below:
SELECT TourId
FROM
(SELECT...
|
by: Skillman |
last post by:
Hi Everybody,
I'm beginer in SQL and was wonder if anybody could take a look at this and help me. I got this error, and not sure how to fix it.
This is the error:
Msg 156, Level 15, State 1, Line...
|
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. ...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |