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

Database-Dataenvironment.

P: n/a
Hello.
I have One problem.
Whan I make database program in Visual Basic 6 which has some Forms. I make
Dataenvironment. There I make connection to my database. In command I select
table or write SQL comand.And Now I can acces to this tabel/ created new
table with SQL command/. Such that, when I put some textbox,datagrid to
first form I can bind this components with created Dataenvironment command.
When I put some commponents to second Form, thirs
form...................................
I can do same thing, so I can bind with created Dataenvironment command.
How Can I make it in Visual Basic.NET.
BEcause when I work with databases, I can make one connection in Server
Explorer, but I must make Dataadapter/Dataset/ for each Form.

Have any Idea how Can i do it, that I created one conection, once I write
Sql command, and on the this conecntion-command I should be accses from each
form ?
Thank You very much for your answer.
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rado,

If I understand correctly, you want a design-time command that you can share
across multiple forms. Unfortunately, you cannot do this in vb.net. The
object-orientedness of vb.net does not allow it. the closest you can get to
that is to place a public command object in a module and use it from code in
each of your forms. This does not provide the design-time interface you
probably want, but it does allow for a single command object used throughout
the application.

This method is not a very good object-oriented solution, but it will fulfill
the basic need you have.

Kirk Graves

"Rado" <r-****@szm.sk> wrote in message
news:O8**************@TK2MSFTNGP10.phx.gbl...
Hello.
I have One problem.
Whan I make database program in Visual Basic 6 which has some Forms. I make Dataenvironment. There I make connection to my database. In command I select table or write SQL comand.And Now I can acces to this tabel/ created new
table with SQL command/. Such that, when I put some textbox,datagrid to
first form I can bind this components with created Dataenvironment command. When I put some commponents to second Form, thirs
form...................................
I can do same thing, so I can bind with created Dataenvironment command.
How Can I make it in Visual Basic.NET.
BEcause when I work with databases, I can make one connection in Server
Explorer, but I must make Dataadapter/Dataset/ for each Form.

Have any Idea how Can i do it, that I created one conection, once I write
Sql command, and on the this conecntion-command I should be accses from each form ?
Thank You very much for your answer.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.