C
Chi Tang
Hi,
The following code shows that I try to pass a 'smalldatetime' data to the
'Today_Date' column when I add a new row to a table. I use the
'DateTimeFormatInfo' object to get the today date but did not know how to
convert to a sql 'smalldatetime'. Thanks for help.
DataSet ds = new DataSet("MyTable");
adapter.Fill(ds, "MyTable");
DataTable tbl = ds.Tables["MyTable];
DataRow row = tbl.NewRow();
row["Today_Date"] = ?; // this column data is a smalldatetime in sql
tbl.Rows.Add(row);
The following code shows that I try to pass a 'smalldatetime' data to the
'Today_Date' column when I add a new row to a table. I use the
'DateTimeFormatInfo' object to get the today date but did not know how to
convert to a sql 'smalldatetime'. Thanks for help.
DataSet ds = new DataSet("MyTable");
adapter.Fill(ds, "MyTable");
DataTable tbl = ds.Tables["MyTable];
DataRow row = tbl.NewRow();
row["Today_Date"] = ?; // this column data is a smalldatetime in sql
tbl.Rows.Add(row);