Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have a Access Database, In visual studio, I have added a connection to the dat

ID: 3849336 • Letter: I

Question

I have a Access Database, In visual studio, I have added a connection to the database (I can see it through server explorer). But I do not know how to use it! What do I need to do in order to create an object pointing to the database so that I can modify some of the values in the database and also seperate some of the rows two or more rows. So basically, I need some way of talking to the database using a connection string or something. Could some explain in detail what exactly I need to do to make that happen? Thanks.

Explanation / Answer

right click on the database in the server explorer and go to properties. A menu will pop up on the right side of visual studio. You need to copy the connection string. This string contains the name of the database you're willing to access in the server, the username and the password.

In order to connect to this database and put this connection string to use you will need to create a connection object.

In order tp make changes to the database you need to create an sqlcommand object. The sqlcommand object accepts a sqlconnection object(the one with the connection string) and a string query.