Hi,
I am having trouble adding data to a MS Access 2003 table.
I have created a MS Access table by hand and added the column types as text.
The code makes the connection, but then it says that the Date column doesn't exsist?????
Any help would be great,
Thanks
string strDataSrc = ";Data Source=";
tempStr = "E:\\temp\\Log.mdb";
strResult = String.Concat(strDataSrc, tempStr);
OleDbConnection conn = null;
conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Password=;User ID=" + strResult);
conn.Open();
OleDbDataAdapter fgADOAdapter = new OleDbDataAdapter();
OleDbCommandBuilder fgCommandBuilder = new OleDbCommandBuilder(fgADOAdapter);
DataTable fgDataTable = new DataTable("Server");
DataRow fgDataRow = fgDataTable.NewRow();
fgDataRow["Date"] = logWeb.LogDate;
fgDataRow["Time"] = logWeb.LogTime;
fgDataTable.Rows.Add(fgDataRow);
fgADOAdapter.Update(fgDataTable);
I am having trouble adding data to a MS Access 2003 table.
I have created a MS Access table by hand and added the column types as text.
The code makes the connection, but then it says that the Date column doesn't exsist?????
Any help would be great,
Thanks
string strDataSrc = ";Data Source=";
tempStr = "E:\\temp\\Log.mdb";
strResult = String.Concat(strDataSrc, tempStr);
OleDbConnection conn = null;
conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Password=;User ID=" + strResult);
conn.Open();
OleDbDataAdapter fgADOAdapter = new OleDbDataAdapter();
OleDbCommandBuilder fgCommandBuilder = new OleDbCommandBuilder(fgADOAdapter);
DataTable fgDataTable = new DataTable("Server");
DataRow fgDataRow = fgDataTable.NewRow();
fgDataRow["Date"] = logWeb.LogDate;
fgDataRow["Time"] = logWeb.LogTime;
fgDataTable.Rows.Add(fgDataRow);
fgADOAdapter.Update(fgDataTable);