Hi and help,
I have written the following code to insert a date from the calendar control into a database. It works fine.
I now wish to have 5 dates entered by clicking a calendar date but with each a different field in the same record of the database. The database will be modified to have 5 date fields.
Can you explain how the code can be modified. I guess the solution is that each date entry/click to be recorded as date1, date2, date3 etc.. but I do not know how to do this.
Thanks
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
SqlConnection conn = null;
SqlDataReader rdr = null;
conn = new SqlConnection("Server=.;DataBase=Manage_My_Chain;Integrated Security=Yes");
conn.Open();
SqlCommand cmd = new SqlCommand("StoredProcedure6", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Date", Calendar1.SelectedDate));
rdr = cmd.ExecuteReader();