sorry my fellow friends
i am able to successfully ad to the first column of listview but i am having error adding submenu items i am posting my code for your understanding, i have 5 column in the listview
here is the error i am getting at the first subitem codeCode:Dim iForLoop As Integer Dim ds As DataSet Dim da As System.Data.OleDb.OleDbDataAdapter sql = "SELECT * FROM tblRoster" da = New OleDb.OleDbDataAdapter(sql, con) ds = New DataSet da.Fill(ds, "tblRoster") sqlR_Count = ds.Tables(0).Rows.Count For iForLoop = 0 To sqlR_Count - 1 Dim New_Item = New ListViewItem New_Item.Text = (ds.Tables("tblRoster").Rows(iForLoop)("eDate")) 'im getting error at the line below New_Item.SubItems(1).Text = (ds.Tables("tblRoster").Rows(iForLoop)("CarNumber")) New_Item.SubItems(2).Text = (ds.Tables("tblRoster").Rows(iForLoop)("DriverName")) New_Item.SubItems(3).Text = (ds.Tables("tblRoster").Rows(iForLoop)("ShiftType")) New_Item.SubItems(4).Text = (ds.Tables("tblRoster").Rows(iForLoop)("PaymentStatus")) lvViewRoster.Items.Add(New_Item) Next iForLoop
any help will be appreciatedCode:InvalidArgument=Value of '1' is not valid for 'index'. Parameter name: index
thanks
shiraz


LinkBack URL
About LinkBacks




Reply With Quote



Bookmarks