this code gives me error of
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Dim i As Integer = 0
For Each r As DataRow In dt.Rows
DataGridView1.SelectedRows(i).Cells("emp_name") = dt.Rows(i)("Emp_Name")
DataGridView1.SelectedRows(i).Cells("emp_id") = dt.Rows(i)("Emp_ID")
DataGridView1.SelectedRows(i).Cells("date_") = dt.Rows(i)("Day_Dat")
i = i + 1
Next
Loading
chellappan pandiarajanPosted Jan 10, 2013, 9:47 AM
DataGridView1.Datasource = dt;
DataGridView1.DataBind();
-Pandian
DRISHTYPosted Jan 9, 2013, 11:28 PM
dt.Rows count.
ahmed fahdPosted Jan 9, 2013, 2:02 PM
chellappan pandiarajanPosted Jan 9, 2013, 1:35 PM
Binding Datatable to Grid view...?
Change the following
dt.rows(i)(""Emp_Name") to dt.rows("Emp_Name").ToString
dt.Rows(i)("Emp_ID") to dt.rows("Emp_ID").ToString
dt.Rows(i)("Day_Dat") to dt.rows("Day_Dat").ToString
Surely The error occured because of left side statement in FOR loop
Pls explain the concept then i will provide the solution..
-Pandian