Connecting Tech Pros Worldwide Forums | Help | Site Map

ADODB.Recordset to DataGridView

krungkrung's Avatar
Newbie
 
Join Date: Nov 2008
Location: Philippines
Posts: 18
#1: Nov 12 '08
Hi, can someone help me solve this 'simple' problem of mine???

I tried populating DatagridView using Recordset but it displayed nothing.
I used DatagridView.DataSource = RecordsetObj. RecordsetObj already has records on it, but why records don't display in DataGrid???
I used DataSet to populate Datagrid using the same code (DatagridView.DataSource = DSObj.Tables(index)) and it displayed the records...

Why is it that if I used recordset, it never display anything. Though no errors occurred during execution. Can somebody give me an idea how can I display record in DatagridView using recordset instead of dataset??? Tnx

Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#2: Nov 12 '08

re: ADODB.Recordset to DataGridView


The DataGridView will display objects based on the Properties.
At a guess, I would think that the RecordsetObj does not have properties that the DataGridView can automatically use.

What is wrong with using the table?
It works, and it's easier to understand.

-Frinny
krungkrung's Avatar
Newbie
 
Join Date: Nov 2008
Location: Philippines
Posts: 18
#3: Nov 12 '08

re: ADODB.Recordset to DataGridView


Hi Frinny!! Tnx for the post...yeah! using table (dataset) is easy indeed.. I just want to explore and exploit the capability of VB.Net when it comes to migrating from VB6 codes..so I will not have a very hard time recoding my old VB6 codes to VB.Net...besides that, I want to make a reusable procedures in Vb.Net that can use both ADO.NET and ADODB...sounds crazy huh?? why should I use ADODB when ADO.NET is now available and indeed much better to use?? well, it is because I still have some solutions that need to use ADODB and...well, its a very complicated and boring explanation, though..whew!! anyway tnx alot!! Btw, I am new to VB.Net. I hope guys like you will never get tired of helping others who are having a hard time making their projects on time...lol (",)
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#4: Nov 12 '08

re: ADODB.Recordset to DataGridView


"exploit" is the key word here.
You are not doing yourself any favors by attempting to downgrade .NET to the levels of vb6 by mixing and matching object types like that.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,137
#5: Nov 12 '08

re: ADODB.Recordset to DataGridView


Quote:

Originally Posted by Plater

"exploit" is the key word here.
You are not doing yourself any favors by attempting to downgrade .NET to the levels of vb6 by mixing and matching object types like that.

I imagine the OP will come to that same conclusion once they've played a little more with .NET (I have to learn the hard way too sometimes)

-Frinny
krungkrung's Avatar
Newbie
 
Join Date: Nov 2008
Location: Philippines
Posts: 18
#6: Nov 13 '08

re: ADODB.Recordset to DataGridView


many tnx guys! (",) ---------------------
Reply


Similar .NET Framework bytes