Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all..


I am new to c#.I need to connect a small table in my c#.net project so i don't want to use SQL database.

Can any one give me a simple application which uses microsoft Access database with c#.net.

So i can store and retreive data from a small table.

please help me in this regard...

Regards

Sunit parmar
Posted
Updated 5-May-11 7:23am
v3
Comments
AspDotNetDev 3-May-11 16:50pm    
Have you considered SQL Server CE? It's a lightweight version of SQL that should already be installed on the user's computer with the .Net Framework.

There are two articles here on codeproject that show you how to connect to an DB2 database from an Microsoft .Net application.

Connection to DB2 from .NET[^]
Connect to DB2 from Microsoft .NET[^]

Hope this helps.
 
Share this answer
 
SQLite

Serverless, SQL-92 compliant, tiny footprint, embedded in loads of mainstream apps including Firefox, and easily used from C#.

Just search for articles on this site for it - here's one:
[^]
 
Share this answer
 
SqlConnection cs1 = new SqlConnection("Data Source=sedc;Initial Catalog=ur databasename;Persist Security Info=True;User ID=ur databaseusername;Password=ur databasepassword");
                        SqlCommand cmd1 = new SqlCommand();
                        cs1.Open();
                        cmd1.CommandText = "sql query";
                        cmd1.Connection = cs1;
                        int a = cmd1.ExecuteNonQuery();
                        cs1.Close();


eg: query: select * from usermaster
usermaster is a table in your database provided .

happy coding
 
Share this answer
 
v2
Comments
RaviRanjanKr 4-May-11 0:38am    
Always wrap your code in "pre" tags :)
I would recommend having a look at some tutorials on msdn etc. They should help you get started.
 
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