| try |
| { |
| string connectionString = @"provider=Microsoft.Jet.OLEDB.4.0;data source=C:\Documents and Settings\choogl\Desktop\workbooktest.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;"""; |
| OleDbConnection conn = new OleDbConnection(connectionString); |
| OleDbCommand cmdupdate = new OleDbCommand(); |
| cmdupdate.Connection = conn; |
| cmdupdate.CommandText = "UPDATE [location$] SET name ='park' WHERE ID ='1'"; |
| conn.Open(); |
| cmdupdate.ExecuteNonQuery(); |
| conn.Close(); |
| } |
| catch (Exception e) |
| { |
| MessageBox.Show(e.ToString()); |
| } |
Hi I'm trying to update a excel sheet but whenever I Debug the code this exception error pop's up:
"System.Data.OleDb.OleDbException: No value given for one or more required parameters."
Can anyone help?
Replies
Know the answer? Post it — somebody with the same question will find it here.