ADO recordset to Datagridview of VB 2005
- From: praveen.praveen.s@xxxxxxxxx
- Date: Mon, 17 Sep 2007 05:15:41 -0700
Hi,
I have installed Visual Studio 2005 and am working on Visual
Basic. I have created a ADODB connection to a DB2 database in a server
whose IP address, Portnumber, hostname... are known to me. I have
created a recordset also and assigned a query to it.
Dim Adcon as ADODB.Connection
Dim Adors as ADODB.Recordset
Adcon = New ADODB.Connection
Adors = New ADODB.Recordset
adcon.open (<Connection String>)
Adors.CursorLocation = CursorLocationEnum.adUseClient
Adors.Open(<Query>, Adcon, CursorTypeEnum.adOpenDynamic,
LockTypeEnum.adLockOptimistic)
DataGridView1.DataSource = Adors
I am using the above mentioned steps. Before Assigning the Recordset
to Data grid view, I have checked if the recordset has values and
found that recordset retreived correct set of records using watch. But
the datagridview remains empty even after using the statement
"DataGridView1.DataSource = Adors". I am not sure why this happens.
Please let me know if there is a solution.
Note: The same piece of code works well in VB 6.0 for a Datagrid
control. Also, when I use project upgrading from VB6.0 to VB 2005, the
same datagrid control is working.
.
- Follow-Ups:
- Re: ADO recordset to Datagridview of VB 2005
- From: Ralph
- Re: ADO recordset to Datagridview of VB 2005
- Prev by Date: ADO recordset to Datagridview of VB 2005
- Next by Date: Re: ADO recordset to Datagridview of VB 2005
- Previous by thread: ADO recordset to Datagridview of VB 2005
- Next by thread: Re: ADO recordset to Datagridview of VB 2005
- Index(es):
Relevant Pages
|