Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / September 2007



Tip: Looking for answers? Try searching our database.

ADO recordset to Datagridview of VB 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
praveen.praveen.s@gmail.com - 17 Sep 2007 13:15 GMT
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.
Ralph - 17 Sep 2007 13:56 GMT
> Hi,
>
>        I have installed Visual Studio 2005 and am working on Visual
> Basic. > <snipped>
>
> Please let me know if there is a solution.

yes, but you need to seek it in a dotNet newsgroup...
You can find a complete list of managed (dotNet) newsgroups here:
http://msdn.microsoft.com/subscriptions/managednewsgroups/list.aspx
Franck - 18 Sep 2007 15:09 GMT
datagrid.refresh :P
Ralph - 18 Sep 2007 17:39 GMT
> datagrid.refresh :P

Shhhhh!

(Most people know the answer, but it's like feeding a lost dog. You do him
no favors. Best to point the way home.)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.