Hi
I just finish dataSet codes as followed:
SELECT date_E, adminname
FROM event
WHERE (ID = ?)
I have a dropDownList that allows user to select ID only and the system will insert date_E and adminname into that table
what is the proper code to get date_e and adminname to use it in my function
- protected void Button1_Click(object sender, EventArgs e)
- {
- string id = DropDownList1.SelectedValue;
-
-
-
- OleDbConnection con = new OleDbConnection("connectionstring");
- try
- {
- OleDbCommand cmd = con.CreateCommand();
- con.Open();
- cmd.CommandText = "Insert into customer Values('" + Session["UserName"] + "','" + ????? + "' , '" + DropDownList1.SelectedValue + "' , '" + ????? + "')";
- cmd.Connection = con;
- cmd.ExecuteNonQuery();
-
- con.Close();
- Label3.Text = "Registered successfully";
- }
- catch (Exception)
- {
- Label3.Text = "database connection problem";
-
-
-
- }
-
- }