Visual Studio 2008 database code?

I want to add a new data in my access and i don't know how... please teach me.

Situation:

whenever i want to push the button, i could add a from my textbox to my data in a particular field.

In VB6 goes something like this

with Myadodc1

recordsource=select * from MSaccesFile

.recordset.fields("user")=textbox1.text

end with

Will anyone mind to convert to VS2008?

Thanks. I'll give 5 star for that

Comments

  • Well you have to create the objects necessary to connect to the database file. This is done using OdbcConnection/OdbcDataAdapter/OdbcCommand or DataSet objects. Through these objects you can execute sql statements using things like the ExecuteReader method on the OdbcCommand object, you could use the Fill method of the OdbcDataAdapter to fill a DataSet etc.

    Look up any of these objects on MSDN and it will provide code to show you how to query your database and fetch back results. It is a little more involved than VB6 use to be, but very efficient and better than it use to be.

    :)

  • you generally do no longer create a database from code... with out understanding what style of database you like, there are to many variables on your question to furnish a step through step answer. reckoning on what style of database you're making use of, you will want a good number of exams to make beneficial the database shape is even cutting-edge on the device working you utility. then you definately would desire to configure the easy plumbing of the database and create a connection string.

Sign In or Register to comment.