protected void gvImages_RowUpdating(object sender, GridViewUpdateEventArgs e) { SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=D:\site\SamsungClassifieds\App_Data\Dorknozzle.mdf;Integrated Security=True;User Instance=True"); con.Open(); AjaxControlToolkit.CalendarExtender date = (AjaxControlToolkit.CalendarExtender)gvImages.Rows[e.RowIndex].FindControl("date3"); //int userid = Convert.ToInt32(gvImages.DataKeys[e.RowIndex].Values["lbladid"].ToString()); Label lbladid = (Label)gvImages.Rows[e.RowIndex].FindControl("lbladid"); TextBox txttitl = (TextBox)gvImages.Rows[e.RowIndex].FindControl("txttitle"); TextBox txtdesc = (TextBox)gvImages.Rows[e.RowIndex].FindControl("txtdesc"); Label lblprice = (Label)gvImages.Rows[e.RowIndex].FindControl("lblprice"); TextBox txtprice = (TextBox)gvImages.Rows[e.RowIndex].FindControl("txtprice"); TextBox txtdate = (TextBox)gvImages.Rows[e.RowIndex].FindControl("txtdate"); SqlCommand cmd = new SqlCommand("UPDATE AD_DETAIL SET AD_TITLE ='" + txttitl.Text + "',AD_DESC ='" + txtdesc.Text + "',AD_PRICE ='" + txtprice.Text + "',DATE =' "+ date.SelectedDate.ToString() +" 'WHERE AD_ID = '" + lbladid.Text + "'", con); //SqlCommand cmd = new SqlCommand("Update AD_DETAIL set AD_TITLE=" + txttitle.Text + "where AD_ID =" + lbladid, con); cmd.ExecuteNonQuery(); gvImages.EditIndex = -1; Binddata(); con.Close(); }
string date= Request.Form[txtDate.UniqueID];
Dim strDate As String = Request.Form(txtDate.UniqueID)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)