hi there, i am new to developing in C# .Net... can any one tell me how to establish a connection between the application developed and the database . i have designed a registration form which has 2 fields - name and employee id.
1.how do u establish a connection between the form and the database.
2.And how to display the database in the data grid placed in the form
Hi there,
You need to add your database to your project
you need to create a new connection string
then you need to connect to the database
then assign the datasource of the datagrid to your datasource
this is a great place to get started
http://msdn2.microsoft.com/en-gb/windowsmobile/default.aspx
You connectin string will probably be something like
sting conString = @"\Program Files\DeviceApplication1\Northwind.sdf";
sqlConnectionString Conn = new sqlConnectionString(conString);
Conn.Open();
then you could query the database
String queryStr = "Select * from Customers";
etc
Here is another place to get some information
http://technet.microsoft.com/en-gb/library/ms173037.aspx