A
abhilashcashok
hi guys, my prblem is that I cannot update sql query against MS ACCESS
using C#. Everytime wen i do so, i got an exception (at runtime) as
'UPDATE syntax not correct'. I don find any error in my 'update'
syntax.
I can successfully run other dbase operations like insertion, deletion
& all.; except Updation.
But, i can successfully run the same update query in the 'sql query
tab' of MS ACCESS, and is executed successfully.
I'm using VS.NET 2005 & MS ACCESS 2003.
please help me...its urgent.
i'm including the code below :
*****************************************************************
string provider = "Provider = Microsoft.Jet.OleDb.4.0; Data Source =
db1.mdb;";
string sql = "update Table1 set Password = 'modify' where ID =
'abhi'";
try
{
OleDbConnection oc = new OleDbConnection(provider);
OleDbCommand od = new OleDbCommand(sql, oc);
oc.Open();
od.ExecuteNonQuery();
oc.Close();
}
catch (Exception exp)
{
return exp.Message;
}
*****************************************************************
My table contains two field : "ID" & "Password", both are of String
type.
*****************************************************************
thanks in advance
using C#. Everytime wen i do so, i got an exception (at runtime) as
'UPDATE syntax not correct'. I don find any error in my 'update'
syntax.
I can successfully run other dbase operations like insertion, deletion
& all.; except Updation.
But, i can successfully run the same update query in the 'sql query
tab' of MS ACCESS, and is executed successfully.
I'm using VS.NET 2005 & MS ACCESS 2003.
please help me...its urgent.
i'm including the code below :
*****************************************************************
string provider = "Provider = Microsoft.Jet.OleDb.4.0; Data Source =
db1.mdb;";
string sql = "update Table1 set Password = 'modify' where ID =
'abhi'";
try
{
OleDbConnection oc = new OleDbConnection(provider);
OleDbCommand od = new OleDbCommand(sql, oc);
oc.Open();
od.ExecuteNonQuery();
oc.Close();
}
catch (Exception exp)
{
return exp.Message;
}
*****************************************************************
My table contains two field : "ID" & "Password", both are of String
type.
*****************************************************************
thanks in advance