Skip to content

OleDbConnection takes long time or give error on unc path

nirali

Asked Jul 16, 2014, 10:33 PM EDT2 answers
Share
LinkedInX

Hello,

I am using C#.NET Application.

Having One Query which Executed With OldDbProvider.

Java
System.Data.OleDb.OleDbConnection oleCon = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + textBox1.Text + ";");
            try
            {
                DateTime dt = DateTime.Now;
                oleCon.Open();
                string emtypeVerificationQry = "SELECT Top 1 [FieldName] FROM [TableName]";
                System.Data.OleDb.OleDbCommand oleCommand = new System.Data.OleDb.OleDbCommand();
                oleCommand.CommandText = emtypeVerificationQry;
                oleCommand.Connection = oleCon;
                object objectRest = oleCommand.ExecuteScalar();
}

I am facing Problem with this Query:

Same Query Executed In machine which have local .mdb file location.

If .mdb file located at UNC/Network Location It takes much time to execute same query and some time it gives Error While Executing Query.

Does any one have resolution of this issue?

Thanks

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi Nirali,
    Can you share the error you are getting
    0
  • 0
    Error Is : Can not execute Query
    0