Stephen Manderson
asked on
Looking for examples of SQL database interaction in VB.net
Hi all
I am new to .net, and have an aging vb6 application thats causing me greif when running in vista.. Ie random crashing etc... Checked for memory leaks etc however doesnt seem to have any.
I need to bite the bullet and start upgrading it to vb.net 2008. I know that there is an upgrade wizard however I have had too many problems with this & also wish to start from scratch.
So heres what id like help with :-)
Could someone provide me examples of the best way to interact with an SQL 2005 database to read and update records ?
Ie
Open a connection execute my SQL statement and retrieve the data. and bind to my controls? mainly text boxes etc..
Also how would I update this info back into the database?
Many Thanks
I am new to .net, and have an aging vb6 application thats causing me greif when running in vista.. Ie random crashing etc... Checked for memory leaks etc however doesnt seem to have any.
I need to bite the bullet and start upgrading it to vb.net 2008. I know that there is an upgrade wizard however I have had too many problems with this & also wish to start from scratch.
So heres what id like help with :-)
Could someone provide me examples of the best way to interact with an SQL 2005 database to read and update records ?
Ie
Open a connection execute my SQL statement and retrieve the data. and bind to my controls? mainly text boxes etc..
Also how would I update this info back into the database?
Many Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many Thanks :-)
ASKER
Just to ask quickly
is there a way to insert a record like in vb6 ?
Ie rs.addnew
rs.Fields("field") = text1.text
rs.Update
?
To save having to declare the inserts in the sql string then also in the body?
Regards
Steve
is there a way to insert a record like in vb6 ?
Ie rs.addnew
rs.Fields("field") = text1.text
rs.Update
?
To save having to declare the inserts in the sql string then also in the body?
Regards
Steve
I don't think so. You don't use recordsets in vb.net.
The CSLA framework give you all the data layer you need to develop applications.
The CLSAgen generate the Business objects layer.
in general (from vb6 to vb.net): don't write your own data access but choose one framework, there a lot freeware / open source.