TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kamala Veni
NA
65
21.3k
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;
Reply
Answers (
4
)
Visual Studio 2012 MVC 4 application, updating a record
settings to save tables