Advertisement

05.12.2008 at 10:24AM PDT, ID: 23395263
[x]
Attachment Details

Determine if DB connection is successful or not

Asked by mmexchange in Microsoft Visual C#.Net, Microsoft Access Database, Visual Studio 2008

Here is code. How/where do I determine if "connection" to database was successful?
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;"
        + "Data Source=" + txtDatabaseName.Text + ";"
        + "Persist Security Info=False;"
        + "Mode=Share Deny None;";
IDbConnection dbConnection = new System.Data.OleDb.OleDbConnection(connectionString);
IDbCommand dbCommand = new System.Data.OleDb.OleDbCommand();
dbCommand.Connection = dbConnection;
IDbDataAdapter dataAdapter = new System.Data.OleDb.OleDbDataAdapter();
DataSet dsOldDB = new DataSet();
Start Free Trial
[+][-]05.12.2008 at 10:50AM PDT, ID: 21549053

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 10:59AM PDT, ID: 21549133

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 11:46AM PDT, ID: 21549505

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.12.2008 at 11:48AM PDT, ID: 21549521

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Microsoft Access Database, Visual Studio 2008
Sign Up Now!
Solution Provided By: Hendo1973
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628