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
poonam tyagi
NA
5
3.5k
c#.net
Aug 12 2014 10:28 AM
Input array is longer than the number of columns in this table. why this error occur in my code
for (int i = 0; i < dataGridView4.Rows.Count-1; i++)
{
//for (int j = 0; j < dataGridView4.Columns.Count; i++)
//{
//for (int i = 0; i < dataGridView4.HeaderRow.Cells.Count; i++)
//{
dt.Rows.Add(dataGridView4.Rows[i].Cells[0].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[1].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[2].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[3].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[13].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[18].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[19].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[21].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[22].Value.ToString());
dt.Rows.Add(dataGridView4.Rows[i].Cells[23].Value.ToString());
da = new OleDbDataAdapter();
da.Fill(d, "dt");
}
Reply
Answers (
1
)
display last ID from bank in label
how can fill dataset by gridview in c# .net