Oledbdataadapter not updating
I already have aform with a list box,a text box and four buttons for inserting,updating,deleting, and inserting records but i havent been able to get the connection to the database.
i am a little bit confused if have to use a connection string and a data Adapter to get a connection to the database everytime i want to perform each action like updating, deleting e.t.c and please how do i write the cade for the update,delete,edit and insert statements as i am a little bit new to ADO.
All we need is to tell it which driver to use and where to find the database file. Then we give it the connection string and open the connection…
If this had been a database like My SQL located on another server, we would have to specify IP address info as well as port. Notice in our code above we create a new Ole Db Connection and give it a connection string to tells it where to find and to use our OLEDB 4.0 driver.
NET and c# platform.below is the code i have written so far but it dosent work.
can anyone please help me in modifying/correcting the the name of my access database is Book CSharp with a table name Books.
While there are many ways to do these things, I simply create 3 different ways that you can play with below.
Think of this method like using a hose to fill up a bucket.
I'll totally forgot about disposing objects and probably start to get in habit building queries with parameters.
Alright as no one had ideas on how to do that different way, I took the code & learn path, which lead me to re-designing adapters little bit.
In this case will command be disposed after using it this way You should use parameterised queries.
I prefer to see all SQL keywords capitalised or not (I personally just go all lower case and face the wrath of my colleagues), a schema on your table name, Pascal Cased column names and a list of columns to be returned.
Nothing much to see here other than how to create the class and use a connection string to tell the connection where to find the database.