Do you mean the format of the date in the SQL string?
The easy way is to not worry about typing the full SQL string. Use Command
objects with Parameters for each field.
SqlCommand cmdUpdate = new SqlCommand();
cmdUpdate.Connection = myConnection;
cmdUpdate.CommandText = new SqlCommand("UPDATE titles SET "
+ "title = @title"+ ", "
+ "type = @type"+ ", "
+ "pub_id = @pub_id"+ ", "
+ "price =
@Price"+ ", "
+ "advance =
@Advance"+ ", "
+ "royalty = @royalty"+ ", "
+ "ytd_sales = @ytd_sales"+ ", "
+ "notes =
@Notes"+ ", "
+ "pubdate = @pubdate"+ " WHERE title_id = @title_id");
.... add first parameters here...
SqlParameter prm9 = new SqlParameter("@pubdate" , SqlDbType.DateTime);
prm9.SourceColumn = "pubdate";
cmdUpdate.Parameters.Add(prm9);
Now make this the UpdateCommand on your DataAdapter.
Michael Lang, MCSD
Take a look at my open source database project code generator...
http://sourceforge.net/projects/dbobjecter