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
Aisha Kaim Khani
NA
2
833
child table can not be updated
Feb 15 2014 5:56 AM
I want to add 3 text boxes values in single table at one time...For this purpose i m using for loop but its giving me eror after inserting first value that the cant update or add the child row...what should i do now....my query is given below.
TextBox[] textBoxes = new TextBox[] { textBox5, textBox6,textBox7 };
try
{
for (int i = 1; i <=3; i++)
{
cmd = connection.CreateCommand();
cmd.CommandText = "INSERT INTO RequirementSkill(ReqSkillName,fk_ReqID)VALUES(@ReqSkillName,LAST_INSERT_ID())";
cmd.Parameters.AddWithValue("@ReqSkillName", textBoxes[i].Text);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
}
}
catch (Exception)
{
throw;
}
Reply
Answers (
0
)
Condition is Not Satisfying
Need to show recent activities to the user