Hi,
I am having trouble adding new rows to an empty MS Access table.
I manually created the table in MS access named server and created two
columns Date & Time.
When I run the following code I get: "Syntax error in INSERT INTO
statement".
Any help would be great.
Thank you.
OleDbCommand fgSelectCommand = conn.CreateCommand();
fgSelectCommand.CommandText = "SELECT TOP 1 * FROM Server";
OleDbDataAdapter fgADOAdapter = new OleDbDataAdapter();
OleDbCommandBuilder fgCommandBuilder = new
OleDbCommandBuilder(fgADOAdapter);
fgADOAdapter.SelectCommand = fgSelectCommand;
DataTable fgDataTable = new DataTable("Server");
fgADOAdapter.FillSchema(fgDataTable, SchemaType.Source);
DataRow fgDataRow = fgDataTable.NewRow();
fgDataRow["Date"] = logWeb.LogDate;
fgDataRow["Time"] = logWeb.LogTime;
fgDataTable.Rows.Add(fgDataRow);
fgADOAdapter.Update(fgDataTable);