PDA

Click to See Complete Forum and Search --> : Data controls different in vs 2003 - 2005 ?


mikelynch
Jun 19th, 2007, 07:02 PM
The vs 2005 Data components are reduced here see , I am trying to
work with example tutorial that uses a much creater selection than available here !


http://www.vbforums.com/attachment.php?attachmentid=57614&stc=1&d=1182296998

Atheist
Jun 19th, 2007, 07:08 PM
What are you after that you cant find?

jmcilhinney
Jun 19th, 2007, 07:09 PM
Nothing from 2003 has been removed, they just aren't displayed in the Toolbox by default. The DataGrid is not displayed because the DataGridView is better in almost all cases. The BindingSource and BindingNavigator are both new. All the provider-specific classes like SqlConnection and OleDbDataAdapter still exist but they are not included in the Toolbox because you are intended to use the new Data Sources feature that makes their direct use obsolete. You can certainly use them if you like though, and many people do. Like any components, if you want to use them in the designer you simply right-click the Toolbox, select Choose Items and then navigate to the library containing the components you want to use.

mikelynch
Jun 19th, 2007, 08:09 PM
I was trying to emulate this old vb example --->

Dim strValue As String
Dim Sql As String = "select pkRoomID,fldStatus from tblRoom where fldStatus = False"
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\VilliageDatabase\Ainslie.mdb"
Dim adapter As New OleDbDataAdapter(Sql, strConn)
Dim ds As New DataSet
Dim intR As Integer
intR = adapter.Fill(ds)

For the moment I will stick with it. I just added using System.Data.OleDb; which works. , I didnt have the namespace completed right through.

thanks. I will look into other ways of implementation.

jmcilhinney
Jun 19th, 2007, 08:18 PM
As I said, you can add the OleDbConnection and OleDbDataAdapter components to the Toolbox if you so desire. Microsoft would prefer you to create a Data Source for your database though, which would generate a typed DataSet including TableAdapters. Your DataSet class and TableAdapter classes will then be automatically added to the Toolbox and you can drag them to forms as needed. The TableAdapters take the place of untyped OleDbDataAdapters and the connection is incorporated into each one already.