Link to home
Start Free TrialLog in
Avatar of Steven
StevenFlag for United States of America

asked on

Saving Data into DB

Hi I’m new in .net and ado.net can some one give me an example on how to save information into my DB I’m using VB.NET THANKS
Avatar of carmodyk
carmodyk
Flag of United States of America image

First, you will have to tell us what database you are using.  Is it MS Access, SQL, MYsql, Firebird, Oracle, Excel?
Hi what sort of DB

is it an SQL database you are using

There are many ways of doing this, what exactlyare you trying to achieve
Avatar of Steven

ASKER

MYSQ.
 SORRY ABOUT THAT
Avatar of Steven

ASKER

I'm Using mysql 5 And I got the ADO.NET provider for MySql. I just need an example on how to add info into a Table
ASKER CERTIFIED SOLUTION
Avatar of carmodyk
carmodyk
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steven

ASKER

I noticed that your using Oledb and I wanto to use ado.net and I also would like to know if its possible to have something like “rs.Fields("Number") = 5” like in vb6

Thanks for your help
This might help most of all.  This is a link to the 101 VB.NET examples provided by Microsoft.  In it, there is an example using ADO 2.6 that you will probably find most useful, including reading, inserting and updating.  You also find that Microsoft's example hasn't gotten away entirely not using Oledb.  

http://www.microsoft.com/downloads/details.aspx?familyid=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en

As you go through some of the examples you'll notice that while Microsoft said it would be easy to migrate from VB6, it is, at least for me, different.  A lot that you learned in VB6 might have to be thrown out the window, especially that which had to deal with database connections and manipulations.  But I'm sure you will like it much better than VB6 as I do.
Avatar of Steven

ASKER

I think the first Answer Will work fine thanks.