Updating access database with

posted by | Leave a comment

” So I figured I would put a few little snippets here to show you some ways it can be done.

We will work on reading a simple column (name) from an Access Database table (Employees) and stick those names into a listbox for selection.

Once we have it in the bucket, we can use the data independent of the connection or adapter.

This example will use the Data Set to “bind” to the listbox and empty its contents into the listbox control. The only trick here is that we bind the database to the listbox and tell the listbox to use the name column as both the names we display to the user as well as the value each item has.

Keep in mind that this would be altering the dataset data, not the database.

So if we see “John” in the listbox, the value of that item will also be “John”.

We could have given it a different value than what it shows.

We could reset the pointer, but then that would kill the speed here.

// Our command object which again uses the connection string and a connection object Ole Db Command cmd = new Ole Db Command("select name from employees", connection); // Our reader is going to fetch our results Ole Db Data Reader reader = cmd.

Leave a Reply

Free sex chat without without payment