update query in MS-ACCESS don't working + C#
hi guys, prblem cannot update sql query against ms access using c#. everytime wen so, got exception (at runtime) 'update syntax not correct'. don find error in 'update' syntax.
i can run other dbase operations insertion, deletion & all.; except updation.
but, can run same update query in 'sql query tab' of ms access, , executed successfully.
i'm using vs.net 2005 & ms access 2003.
please me...its urgent.
i'm including code below :
*****************************************************************
string provider = "provider = microsoft.jet.oledb.4.0; data source = db1.mdb;";
string sql = "update table1 set password = 'modify' 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 2 field : "id" & "password", both of string type.
*****************************************************************
thanks in advance
i can run other dbase operations insertion, deletion & all.; except updation.
but, can run same update query in 'sql query tab' of ms access, , executed successfully.
i'm using vs.net 2005 & ms access 2003.
please me...its urgent.
i'm including code below :
****************************************
string provider = "provider = microsoft.jet.oledb.4.0; data source = db1.mdb;";
string sql = "update table1 set password = 'modify' 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 2 field : "id" & "password", both of string type.
****************************************
thanks in advance
the word "password" reserved string in update sql query. change the column name other "password".
this must solvbe problem.
SQL Server > SQL Server Data Access
Comments
Post a Comment