ms access 2007 update query?
-
hi, in C# got error while executing update query. error is "syntax error in update statement". my connection string is strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Directory.GetCurrentDirectory() + "\\album.accdb;Persist Security Info=False"; query statement m_thisCommand = m_thisConnection.CreateCommand(); strTemp = "update users set password='admin' where username='admin'"; m_thisCommand.CommandText = strTemp; m_thisCommand.ExecuteNonQuery(); here m_thisCommand is OleDbCommand m_thisConnection is OleDbConnection Thanks in advance
Have A Nice Day! Murali.M Blog
-
hi, in C# got error while executing update query. error is "syntax error in update statement". my connection string is strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Directory.GetCurrentDirectory() + "\\album.accdb;Persist Security Info=False"; query statement m_thisCommand = m_thisConnection.CreateCommand(); strTemp = "update users set password='admin' where username='admin'"; m_thisCommand.CommandText = strTemp; m_thisCommand.ExecuteNonQuery(); here m_thisCommand is OleDbCommand m_thisConnection is OleDbConnection Thanks in advance
Have A Nice Day! Murali.M Blog
-
hi, in C# got error while executing update query. error is "syntax error in update statement". my connection string is strConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Directory.GetCurrentDirectory() + "\\album.accdb;Persist Security Info=False"; query statement m_thisCommand = m_thisConnection.CreateCommand(); strTemp = "update users set password='admin' where username='admin'"; m_thisCommand.CommandText = strTemp; m_thisCommand.ExecuteNonQuery(); here m_thisCommand is OleDbCommand m_thisConnection is OleDbConnection Thanks in advance
Have A Nice Day! Murali.M Blog
-
i think u r missing a statement... m_thisCommand.CommandType = CommandType.Text; please try this,,,
DineshT
Commandtype.text is default and does not need to be specified. Oh, and Txtspeak is considered immature and shouldn't be used in professional context.
Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller