How to create a table in a MS access database in C#
<p>I need to create a table in MS access database.
Consider, 'ConfigStructure.mdb' being my database name and i need to create a table in this database in C#.</p>

<p>How can i do this? I tried with the below code but its not working. </p>

<pre><code>        OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + frmMain.strFilePath + "\\ConfigStructure.mdb");
        myConnection.Open();
        string strTemp = " KEY Text, VALUE Text ";
        OleDbCommand myCommand = new OleDbCommand();
        myCommand.Connection = myConnection;
        myCommand.CommandText = "CREATE TABLE table1(" + strTemp + ")";
        myCommand.ExecuteNonQuery();
        myCommand.Connection.Close();
</code></pre>

<p>This is the error that i get,</p>

<pre><code>"System.Data.OleDb.OleDbException: Syntax error in field definition
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object&amp; executeResult)\r\n   at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&amp; executeResult)\r\n   at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object&amp; executeResult)\r\n   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)"
</code></pre>
