Re: simple data form



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


.



Relevant Pages

  • Re: Access and processor usage
    ... "increased bandwidth" using ADO. ... bottleneck - need to step up to Sql Server. ... If the data fits into a 2 GB database file, ...
    (comp.databases.ms-access)
  • Re: How to access the SQL server express from mfc application?
    ... There are different ways to do this via MFC. ... You could certainly try ADO, ... the entire contents of the database to a SQL Server Standard Server. ...
    (microsoft.public.vc.mfc)
  • Re: Connecting to a SQL Server 2005 using VBA and ADO
    ... dao should work just fine.... ... the above example when using sql server, or a plan Jane un-split database, ... I would not use findfirst even when not using sql server unless the data set ... Microsoft since they now seem to be favoring ADO. ...
    (microsoft.public.access.formscoding)
  • Re: MS Access DAO -> ADO.NET Migration
    ... William Vaughn ... Microsoft MVP ... Hitchhiker's Guide to Visual Studio and SQL Server ... My migration app works building a SSCE database file with imported data ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cluster will not fail over.
    ... > As far as the TCP/IP issue goes, you had to rebuild the cluster and were ... > able to restore the master database. ... > a cluster installation you'll have to revisit. ... >> This worked bringing up the sql server in minimal mode. ...
    (microsoft.public.sqlserver.clustering)