i have signup webform and i have written insert query on signup button.
It was working correctly.But i have added fileupload for image uploading and after changing this.My data is not getting inserted.Please help.
Here is my code-
SqlConnection conn = new SqlConnection("Data Source=SNEHAL-PC\\SNEHAL1;Initial Catalog=TEMPRUJU;Integrated Security=True");
SqlCommand cmd;
cmd = new SqlCommand("insert into login(name,midname,surname,username,password,contact,dob,email,address,occupation,ltype,image) values('" + txtfirst.Text + "','" + txtmid.Text + "','" + txtsur.Text + "','" + txtname.Text + "','" + txtpass.Text + "','" + txtcontact.Text + "','" + txtdob.Text + "','" + txtemail.Text + "','" + txtaddr.Text + "','" + txtocc.Text + "','" + typeButtonList1.SelectedValue + "','"+image1.ImageUrl+"')", conn);
cmd.ExecuteNonQuery();
Response.Redirect("WebForm1.aspx");
protected void btn_upload_Click(object sender, EventArgs e)
{
lbl_test.Text = "";
if (fileimage1.HasFile)
{
FileUpload fileupload1 = fileimage1;
String v_folder = "imageupload/";
fileupload1.SaveAs(Server.MapPath(v_folder) + fileupload1.FileName);
image1.ImageUrl = v_folder + fileupload1.FileName;
String extension;
extension = Path.GetExtension(image1.ImageUrl);
if (extension == ".png" || extension == ".PNG" || extension == ".JPEG" || extension == ".jpeg" || extension == ".jpg" || extension == ".JPG" || extension == ".gif" || extension == ".GIF" || extension == ".bmp" || extension == ".BMP" || extension == ".TIF" || extension == ".tif" || extension == ".psd" || extension == ".PSD")
{
lbl_test.Text = "File uploaded successfully";
}
else
{
lbl_test.Text = "please upload Image file";
}
}