Monday, October 24, 2011

Code for Datetime.Now as parameter

string query = "select * from appointments where start_date = @startdate";
SqlCommand cmd = new SqlCommand();
cmd.CommandText = query;
cmd.Parameters.Add ("@startdate", SqlDbType.DateTime);
cmd.Parameters["@startdate"].Value = DateTime.Now

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.