I've design a datagridview with 6 columns. But i got a code somewhere in internet,the code make my datagridview added with 8 more columns from database. i dont know how to put the data from database into specific columns in the designed datagridview. on database, i have 8 columns, but i want to retrieve data from 3rd until the last row. database column name =id, agentname, customername, icnum, address, phonenum, dateform, emailcust.
can someone help me??
this is the code
Try mycn.Open() da = New OleDbDataAdapter("select*from custlist where agentnamecust= '" & Me.agentlist.Text & "' ", mycn) 'create command builder Dim cb As OleDbCommandBuilder = New OleDbCommandBuilder(da) 'fill dataset da.Fill(ds, "custlist") KryptonDataGridView1.DataSource = ds KryptonDataGridView1.DataMember = "custlist" Catch ex As OleDbException MsgBox(ex.ToString) Finally ' Close connection mycn.Close() End Try
Edited by zarifin99ska: n/a