Kamala Veni

Kamala Veni

  • NA
  • 65
  • 20.1k

How to Insert The 7 Day Records and save in the SqlTable?

Feb 25 2016 5:10 AM
I am having a form with 10 Columns ,in that i wanna insert data up to next seven days  and Save now itself,
 bt  while am inserting  data,its show oly 7th day record as saved in tha sql table,now it doesnt storing other 6 day records in table.
hw to clear dat ?
 
my code: 
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["Name"].ConnectionString; cnn.Open();
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "select * from tbl_sch1";
cmd.Connection = cnn; SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "tbl_sch1");
SqlCommandBuilder cb = new SqlCommandBuilder(da);
DataRow drow = ds.Tables["tbl_sch1"].NewRow();
drow["Day"] = lbd.Text;
drow["Time"] = lbb.Text;
drow["Date"] = lb.Text;
drow["blk_1"] = txtb1.Text;
drow["blk_2"] = txtb2.Text;
drow["blk_3"] = txtb3.Text;
drow["blk_4"] = txtb4.Text;
drow["blk_5"] = txtb5.Text;
drow["blk_6"] = txtb6.Text;
drow["blk_7"] = txtb7.Text;
drow["blk_8"] = txtb8.Text;
drow["blk_9"] = txtb9.Text;
drow["blk_10"] = txtb10.Text;
 

Answers (4)