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";
- }
- }
Thiruppathi RPosted May 25, 2017, 3:28 AM
Thiruppathi RPosted May 25, 2017, 3:21 AM
Amit GuptaPosted May 25, 2017, 1:55 AM
Sulieman AlkatibPosted May 24, 2017, 5:04 PM
Amit GuptaPosted May 24, 2017, 2:30 PM