I am trying to create a table in my Winform using the following lines of code, but am unable to do so:
using (OleDbConnection excelConnection = new OleDbConnection(connectionString))
{
OleDbCommand excelCmd = new OleDbCommand();
excelCmd.Connection = excelConnection;
excelCmd.ExecuteNonQuery();//This particular statement will rise the above exception.
}
The following are a few details of the exception:
System.Data.OleDb.OleDbException {"Cannot modify the design of table 'TestSheet'. It is in a read-only database."}
I have even checked the Properties of my database and the "Read-only" option is unchecked.
Looking forward to hearing from you,
Thanks,
Abhisheik.