protected void Button1_Click(object sender, EventArgs e) { int id = Convert.ToInt32(Request.QueryString["Code"]); string filename = FileUpload1.ToolTip; if (FileUpload1.HasFile) { filename = FileUpload1.FileName; FileUpload1.SaveAs(Server.MapPath("pics\\") + filename); } SqlConnection con = new SqlConnection(); con.ConnectionString = "Data Source=.;Initial Catalog=tbldms1;Integrated Security=True"; string q = "update ooo set title=@title,photo=@photo,where id=@id"; SqlCommand cmd = new SqlCommand(q, con); cmd.Parameters.AddWithValue("@id", id); cmd.Parameters.AddWithValue("@title", TextBox1.Text); cmd.Parameters.AddWithValue("@photo",filename); con.Open(); cmd.ExecuteNonQuery(); con.Close(); TextBox1.Text = ""; }
string q = "update ooo set title=@title,photo=@photo,where id=@id";
string q = "update ooo set title=@title,photo=@photo where id=@id";
TextBox1.Text
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)