Thursday, 12 September 2013

How to Update Excel sheet data using asp.net

How to Update Excel sheet data using asp.net

i want to update excel data for that i have used following query--
OdbcConnection con = new
OdbcConnection(ConfigurationManager.ConnectionStrings["SportTech"].ConnectionString);
OdbcCommand cmd; con.Open();
string query = "UPDATE [Sheet1$] SET POSITION=\"" + pos + "\",Time=\"" +
time + "\",Point=\"" + point + "\" WHERE NAME=" + name;
cmd = new OdbcCommand(query,con);
string x = cmd.ExecuteNonQuery().ToString();
MessageBox.Show(x.ToString());
but the query is showing error----
ERROR [42000Ձ] [Microsoft][ODBC Excel Driver] Syntax error in UPDATE
statement.
So please help me

No comments:

Post a Comment