| | |
ADO.Net SQL UPDATE using OleDBAdapter
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2004
Posts: 2
Reputation:
Solved Threads: 0
Hi, I am having a problem with ADO.Net and ASP.Net, I didn't post this in the ASP.Net forum because eventhough I am using ASP.Net, the problem seems to be with ADO.Net.
Anyway the code:
try
{
strSQL = "UPDATE Clients SET Password = '" + newpass + "'" +
" WHERE Email='" + User.Identity.Name + "'";;
dbCon = new OleDbConnection(strCon);
dbCon.Open();
dbAdapter = new OleDbDataAdapter();
dbCom = new OleDbCommand(strSQL,dbCon);
int x= dbCom.ExecuteNonQuery();
//...code continues
Everytime i execute this, I get an exception thrown message: "Syntax error in UPDATE statement."
I tried this same query in MS Access and it works fine (i am using an Access db).
I have no clue what the error means
I don't think its the SQL statement. I thought it might be the OleDbCommand not having the capability but OleDbDataAdapter.UpdateCommand is also OleDbCommand so that can't be it.
Thanks in advance.
Anyway the code:
try
{
strSQL = "UPDATE Clients SET Password = '" + newpass + "'" +
" WHERE Email='" + User.Identity.Name + "'";;
dbCon = new OleDbConnection(strCon);
dbCon.Open();
dbAdapter = new OleDbDataAdapter();
dbCom = new OleDbCommand(strSQL,dbCon);
int x= dbCom.ExecuteNonQuery();
//...code continues
Everytime i execute this, I get an exception thrown message: "Syntax error in UPDATE statement."
I tried this same query in MS Access and it works fine (i am using an Access db).
I have no clue what the error means
I don't think its the SQL statement. I thought it might be the OleDbCommand not having the capability but OleDbDataAdapter.UpdateCommand is also OleDbCommand so that can't be it.Thanks in advance.
![]() |
Similar Threads
- Update from Asp.net to Sql server db (ASP.NET)
- ASP.NET/SQL Developer/Programmer (Web Development Job Offers)
- SQL Server and ADO.net (Computer Science)
- Freelance .NET / MS SQL developer (Web Development Job Offers)
- I am confused and I need some help with VB.NET/SQL Server/ADO.NET (VB.NET)
- Software Engineer (.NET , SQL) (Software Development Job Offers)
- Long ado net question but urgent help required (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: If-Else in C#
- Next Thread: Please~~~ Need help including sound files in the form!
| Thread Tools | Search this Thread |
.net access algorithm api array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop php picturebox pixelinversion platform post programming radians regex remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml





