Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 VB.NET
Public Class Form1
    Dim con As ADODB.Connection
    Dim rs As ADODB.Recordset
    Dim tb As DataTable
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        con = New ADODB.Connection
        rs = New ADODB.Recordset
        tb = New DataTable
        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\AMEER & SONS\AMEER&SONS.mdb;Persist Security Info=False"
        con.CursorLocation = ADODB.CursorLocationEnum.adUseClient
        con.Open()
        rs.Open("company_info", con, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, 2)
        grid.DataSource = rs
    End Sub
End Class
This code does not show the error message but datagridview does not show data why? Thanks in advanced.
 
Edit TR : Please read the posting guidelines and do not SHOUT.
Posted 20-Feb-10 20:32pm
Edited 15-Apr-10 11:14am
v3
Page 1 of 3

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 44

You havn't mapped any data to your DataTable, which you would use to fill the Grid:
 
tb = New DataTable
...
grid.DataSource = tb
 
  Permalink  
Comments
Member 10403037 at 15-Feb-14 18:56pm
   
how to fill the grid?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 55

rs.Open("ventas", con, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, 2)
Form10.DataGridView1.DataSource = tb
 
Would be someting like this?
  Permalink  
Page 1 of 3
1 2 3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 15 Feb 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100