Newbie database question

  • Thread starter Thread starter jy836
  • Start date Start date
J

jy836

Hey all. I'm a newbie to VB .NET (though I've programmed somewhat in VB3 in
the past). I'm trying to display the contents of a MS Access 2000 database
inside a DataGrid, but I don't know how to make the connection. The database
is on my hard drive. I am using Visual Studio .NET 2003 on Windows XP Home
Edition. Can someone please help? I'd appreciate it.

Thanks in advance.

Jay
 
jy836 said:
Hey all. I'm a newbie to VB .NET (though I've programmed somewhat in VB3 in
the past). I'm trying to display the contents of a MS Access 2000 database
inside a DataGrid, but I don't know how to make the connection. The database
is on my hard drive. I am using Visual Studio .NET 2003 on Windows XP Home
Edition. Can someone please help? I'd appreciate it.

Thanks in advance.

Jay

Check out the OLEDB namespace. It has all the classes for Access... I
don't have any examples on me, but try to google OLEDB.NET and see what pops
up for ya.

Sueffel
 
try www.connectionstrings.com and look at the Access connection string...
Just initialize a connection

Dim cn as New OleDbConnection("ConnectionStringHere)
Dim cmd as OleDbCommand("SomeSqlStatement", cn)
If cn.State <> ConnectionState.Open Then cn.Open
'I'm ignoring exception handling here, but you'll want to include it in
production code
'At this point, your database should be open if everything was done
correctly with your sql, connection string and have permisssion to execute.

HTH,

Bill
 
* "jy836 said:
Hey all. I'm a newbie to VB .NET (though I've programmed somewhat in VB3 in
the past). I'm trying to display the contents of a MS Access 2000 database
inside a DataGrid, but I don't know how to make the connection. The database
is on my hard drive. I am using Visual Studio .NET 2003 on Windows XP Home
Edition. Can someone please help? I'd appreciate it.

Did you have a look here?

<http://www.connectionstrings.com>
 
jy836 said:
Hey all. I'm a newbie to VB .NET (though I've programmed somewhat in VB3 in
the past). I'm trying to display the contents of a MS Access 2000 database
inside a DataGrid, but I don't know how to make the connection. The database
is on my hard drive. I am using Visual Studio .NET 2003 on Windows XP Home
Edition. Can someone please help? I'd appreciate it.


http://msdn.microsoft.com/library/en-us/vbcon/html/vboriWindowsFormsDataArchitecture.asp

http://msdn.microsoft.com/library/en-us/vbcon/html/vboriIntegratingDataVB.asp
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaccessingdatawithadonet.asp


Group for ADO.NET related questions:
microsoft.public.dotnet.framework.adonet
 
Back
Top