Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
How can i establish a connection to an Access database in my C# application ?
Posted
Updated 20-Feb-14 15:39pm
v5
Comments
Sergey Alexandrovich Kryukov 20-Feb-14 18:18pm    
What have you tried so far?
You can find millions of answers, written and overwritten...
—SA
BillWoodruff 20-Feb-14 21:43pm    
Sergey, this is the OP's first post on CodeProject; I see no reason to insult him, or her.

I think we should welcome first-time posters gracefully, particularly those from other countries where English is not a "first-tier" language, and extend a certain amount of "credit" to them, intellectually: soon enough we'll know whether they are serious, or not.
Sergey Alexandrovich Kryukov 20-Feb-14 22:51pm    
You know, basically I agree with you, but the advice to start from telling us what was attempted to do does not carry any negative meaning.
I'll join you welcome words...
—SA
BillWoodruff 20-Feb-14 21:47pm    
Welcome to CodeProject, Member 10582335, please read the Guidelines on how to use the QA forums. A small amount of effort by you to create Tags for your posts that communicate what you are doing will make it easier for people here to assist you.

Specific details, and descriptions of specific errors, really help to focus on the solving the problem. And very carefully selected pieces of your code that illustrate the problem are most helpful.

When you are asking broad questions, like "how do I get started with ...," then describing what you've already tried ... whether it worked, or not ... is a very good thing to do.

There are many ways to do it. An easy way is to use the SqlConnection, SqlCommand, and SqlDataReader classes but you'll want to study ADO.Net to learn which other methods may be better for you.

Also, refer to http://www.connectionstrings.com/[^] which will help you know how to tell your code where the database is.
 
Share this answer
 
Simply achieve through OleDb[^].
See msdn[^].

-KR
 
Share this answer
 
for your reference, you may try this tutorial..
http://www.dotnetperls.com/sqlconnection
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900