how to define the oledbconnection

Hi,
I tried to define the oledbconnection as follows:
oledbconnection myconnection=new oledbconnection("provider=microsoft.jet.OLEDB.4.0,datasource=c:\inetpub\wwwroot\test\employee.mdb")


but that doesn't work,it gives me an error(the conntectionstring property has not been intialized),how to solve that experts?
lion79Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

amit_gCommented:
Show more code and the exact location you get this error.
lion79Author Commented:
i want to know that in general,but here is my code:

OleDbConnection myConnection = new OleDbConnection("provider=microsoft.jet.OLEDB.4.0,datasource=c:\inetpub\wwwroot\test\employee.mdb")
                  myConnection.Open();

                  const string SQL = @"SELECT DepartmentID, Name FROM Departments WHERE DivisionID = @DivisionID ORDER BY Name";
                  OleDbCommand myCommand = new OleDbCommand(SQL, myConnection);
                  myCommand.Parameters.Add(new OleDbParameter("@DivisionID", divID));

                  ddlDepartment.DataSource = myCommand.ExecuteReader();
                  ddlDepartment.DataBind();

                  myConnection.Close();
amit_gCommented:
And which line do you get the error? Try changing it to...

OleDbConnection myConnection = new OleDbConnection("provider=microsoft.jet.OLEDB.4.0,datasource=c:\inetpub\wwwroot\test\employee.mdb;User Id=admin;Password=;")

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.