By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,163 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,163 IT Pros & Developers. It's quick & easy.

using database in dotnet IDE

P: n/a
Hello,

In the IDE of microsoft visual studio .NET 2003 :

How can I use simple database using a connectionString, and a data-grid that
linked to a database table (i.e mdb - only within the IDE environment of the
Microsot Visual Studio .NET 2003, and link some of the fields to a database
table/query) ?

Should I use the oleDBConnectionString (but what other components I should
use) ?

Need a sample, please.

Thanks :)


Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
John,

This is nicer, I showed that link in the message below, because I found it
not a method to ask in that ugly way here a question.

The most simple code what you have to place your form load event when you
have dragged a datagrid on your form and clicked on your form where that
form event shows than up.
\\\
dim ds as new dataset
dim conn as new oledb.oledbconnection(SeeLinkBellowForThat)
dim da as new oledb.oledbdataadapter("Select * from mydatabasetable",conn)
da.fill(ds)
datagrid1.datasource = ds.tables(0)
///
When it is SQLserver change than Oledb.Oledb in SQLClient.SQL the same is
for Oracle, however check that than yourself.

Your complete databasetable will be showed. Typed in this message so watch
typos.

www.connectionstrings.com

I hope this helps

Cor

Nov 21 '05 #2

P: n/a
John,
The most simple code what you have to place your form load event when you
have dragged a datagrid on your form and clicked on your form where that
form event shows than up.
I changed the sentence above to many times

The most simple is, to place the code bellow in your form load event. You
get this when you drag first a datagrid from the toolbox on your form. Than
you click on an empty place on your form and then the load event will be
created and the code will be showed. You can then place the code I showed
you, inside that event and start debugging.

Cor

"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:Oj**************@TK2MSFTNGP12.phx.gbl... John,

This is nicer, I showed that link in the message below, because I found
it not a method to ask in that ugly way here a question.

The most simple code what you have to place your form load event when you
have dragged a datagrid on your form and clicked on your form where that
form event shows than up.
\\\
dim ds as new dataset
dim conn as new oledb.oledbconnection(SeeLinkBellowForThat)
dim da as new oledb.oledbdataadapter("Select * from mydatabasetable",conn)
da.fill(ds)
datagrid1.datasource = ds.tables(0)
///
When it is SQLserver change than Oledb.Oledb in SQLClient.SQL the same is
for Oracle, however check that than yourself.

Your complete databasetable will be showed. Typed in this message so watch
typos.

www.connectionstrings.com

I hope this helps

Cor

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.