Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir,
I am try to make windows form application.but I Don't know how to atabase access in windows form appllication.
If you have any book or any useful link for that then plz give me.

I use Visual studio 2008..
Posted

Check this

Using ADO.NET for beginners[^]
Also check MSDN[^] too
 
Share this answer
 
Comments
ambarishtv 28-Jan-12 2:18am    
+5
Sergey Alexandrovich Kryukov 28-Jan-12 2:58am    
Sure, a 5.
--SA
 
Share this answer
 
v2
Accesing Database in Windows Forms Application is Simple as Web
you can Access it by including
C#
using System.Data.SqlClient;

in the header

and

Create an object of SqlConnection class by
C#
SqlConnection con=new SqlConnection("connectionstring");

here connection string would be like
C#
Data Source=SOFTWARE27\\SQLEXPRESS;Initial Catalog=AssetTrack;Integrated Security=True


you should change your server name ie DataSource ,itial ctalog ie database name;

then to do transactions you should maintain an Open Connection.

ie
C#
con.Open();

the write the code in button click
such as to insert data
C#
SqlCommand cmd;
cmd= new SqlCommand(query, con);
cmd.ExecuteNonQuery();

Think this Might Help You
Happy Programming;-)
 
Share this answer
 
v2

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