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
John Joe
NA
81
16.2k
counting row and increment primary key with the next row
Apr 17 2013 5:00 AM
Here is my code: ( It is not working)
sc.Open();
cmd = new SqlCommand("SELECT COUNT (*) FROM Records", sc);
Int32 count = (Int32)cmd.ExecuteScalar();
if (count >= 0)
for (int i = 1; i < count; i++)
cmd = new SqlCommand("Insert into Records(Num, Faculty, Intake, Location, Years, University, Fees, Courses) values('" +1+ "','" + DropDownList5.SelectedItem.Text + "','" + DropDownList2.SelectedItem.Text + "','" + DropDownList4.SelectedItem.Text + "','" + DropDownList6.SelectedItem.Text + "','" + DropDownList7.SelectedItem.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "')", sc);
sc.Close();
Reply
Answers (
4
)
C# - Grant access to special forms only to admins -
keyboard arrow keys in c sharp?