Whya the datas are not updating by this coding given below ...no any error message is giving but data are not updating.
my cs code is given below
void submit(Object s, EventArgs e)
{
con.Open();
if ((File1.PostedFile != null) && (File1.PostedFile.ContentLength > 0))
{
fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);
fn = txtName.Text.Trim() + fn;
SaveLocation = Server.MapPath("~/Upload/" + fn);
txtPhoto.Text = SaveLocation;
}
else
{
string v = Request.QueryString["value1"];
ds = new DataSet();
string sql = "select photo FROM joining where refno='" + v + "' ";
da = new OleDbDataAdapter(sql, con);
da.Fill(ds, "joining");
DataRow dRow = ds.Tables["joining"].Rows[0];
txtPhoto.Text = dRow["photo"].ToString();
}
com = con.CreateCommand();
if (con != null)
{
com.CommandText = "UPDATE joining SET aname = '" + txtName.Text.Trim() + "',fathname='" + txtFather.Text.Trim() + "',dob='" + txtDOB.Text.Trim() + "',pob='" + txtPOB.Text.Trim() + "',add1='" + txtAdd.Value + "',mob='" + txtMob.Text.Trim() + "',city='" + txtCity.Text.Trim() + "',state='" + txtState.Text.Trim() + "',pcode='" + txtPCode.Text.Trim() + "',panno='" + txtPAN.Text.Trim() + "',nominee='" + txtNominee.Text.Trim() + "',relation='" + txtRelation.Text.Trim() + "',photo='" + txtPhoto.Text.Trim() + "',bank='" + txtBank.Text.Trim() + "',branch='" + txtBranch.Text.Trim() + "',account='" + txtAccount.Text.Trim() + "',acctype='" + ddAccType.SelectedItem.Text + "',intby='" + txtIntro.Text.Trim() + "',codno='" + txtCodno.Text.Trim() + "',agent='" + txtACode.Text.Trim() + "',point='" + txtPoints.Text.Trim() + "' where refno='" + txtRefNo.Text.Trim() + "'";
try
{
int count = com.ExecuteNonQuery();
System.Web.UI.WebControls.Label lbl1 = new System.Web.UI.WebControls.Label();
lbl1.ForeColor = System.Drawing.Color.Yellow;
lbl1.BackColor = System.Drawing.Color.Blue;
lbl1.Text = "Your record UPDATED sucessfully";
ph1.Controls.Add(lbl1);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
con.Close();
}