I just want to set the connection with the database in c#
Yes it is possible, for that you have to follow some steps:
1) First add
at to top of the CS file.
2) Create connection string and open connection.For access 2007
string ConnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\abc.mdb;Jet OLEDB:Database Password=password";
OleDbConnection MyConn = new OleDbConnection(ConnStr);
3) Open this connection.
4) Create object for command and reader to get the data from access database.
OleDbCommand Cmd = new OleDbCommand(StrCmd, MyConn);;
OleDbDataReader ObjReader = Cmd.ExecuteReader();
5) Now lood through the reader object to get the data
if (ObjReader != null)
6) After completing the processing