UserId int ImageName image
if (FileUpload1.HasFile) { byte[] ImageName = FileUpload1.FileBytes; string query = "Insert into Pictures(UserId,ImageName)values('" + Session["Id"].ToString() + "',@imagename)"; SqlConnection conn = new SqlConnection(connstr); SqlCommand com = new SqlCommand(query, conn); com.Parameters.Add("@imagename", SqlDbType.VarBinary).Value = ImageName; conn.Open(); com.ExecuteNonQuery(); conn.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)