Re: simple data form
- From: "S.M. Altaf [MVP]" <smaltaf@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Oct 2005 13:12:36 +0100
Hi TR,
In VB.NET, it's best to handcode your connections to the database. ADO.NET
is different from plain ol' ADO, and it would be best to connect using code,
as you'd learn more about the intricacies of ADO.NET this way. When you say
that "it always tries to connect to a sql server" I'm guessing that you're
using a drag-drop method from the Server tab in VS.NET.
To connect to an Access database and get a DataSet out of it, you can use
code like this:
Dim objConnection As New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source
=C:\Northwind.mdb")
Dim objCustomerDA As New OleDbDataAdapter("Select * from Customers",
objConnection)
Dim objCustomerCB As New OleDbCommandBuilder(objCustomerDA)
Dim objDataSet As New DataSet
objConnection.Open()
objDataSet.Clear()
objCustomerDA.Fill(objDataSet, "Customers")
HTH
S.M. Altaf [MVP - VB]
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
"TR" <TR@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:11990CB5-ECB0-4B63-9AAC-000863C748F5@xxxxxxxxxxxxxxxx
> in vb6 to create a form with text boxes and a data grid that links to a
> database is a simple task...in vb.net there is no data control...what do i
> need to do to create a similar form in vb.net...i tried this and it always
> tries to connect to a sql server ...all i want is to connect to a database
> on
> my local drive...can anyone help please
.
- Prev by Date: Re: Problem reading column of type 'text' from Sql server
- Next by Date: Sorting recordsets
- Previous by thread: ADO table from a recordset
- Next by thread: Sorting recordsets
- Index(es):
Relevant Pages
|
|