nirali

nirali

  • NA
  • 3
  • 1.3k

OleDbConnection takes long time or give error on unc path

Jul 17 2014 2:33 AM

Hello,

I am using C#.NET Application.

Having One Query which Executed With OldDbProvider.

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


Answers (2)