protected void SaveRecords_Click(object sender, EventArgs e)
{
for (int index = 0; index < Repeater1.Items.Count; index++)
{
Label lblSno = Repeater1.Items[index].FindControl("lblSno") as Label;
Label lblItemName = Repeater1.Items[index].FindControl("lblItemName") as Label;
Label lblItemQuantity = Repeater1.Items[index].FindControl("lblItemQuantity") as Label;
Label lblItemPrice = Repeater1.Items[index].FindControl("lblItemPrice") as Label;
Label lblItemTotalPrice = Repeater1.Items[index].FindControl("lblItemTotalPrice") as Label;
string FileName = Path.GetFileName(ImageUpload.PostedFile.FileName);
FileName = Guid.NewGuid().ToString();
String strConnString = ("Data Source=.;Initial Catalog=PRODUCT;Integrated Security=True");
SqlConnection con = new SqlConnection(strConnString);
string strQuery = "insert into tbl_Product (Sno,ItemName,ItemImage,ItemQuantity,ItemPrice,Total)values('" + lblSno.Text + "','" + lblItemName.Text + "','" + FileName + "','" + lblItemQuantity.Text + "','" + lblItemPrice.Text + "','" + lblItemTotalPrice.Text + "')";
SqlCommand cmd = new SqlCommand(strQuery, con);
con.Open();
cmd.ExecuteNonQuery();
Response.Write("<script>alert('Data Successfully Saved');</script>");
}
}
THIS SAVE ALL THE RECORD BUT THE IMAGE COLUMN SHOWN THERE EMPTY ANY HAVA ANY IDEA TO SOLVE
yOUR SINSER mIAN sAHIB jaN