Hi everybody!
I want to make a connection on my geodatabase to make command for selecting a specific table
to view it in dataGridView
but i have an error i couldn't fix it
anyone can help me
Code
C#
/ /connect to the database
string conString =
@"Provider=Microsoft.JET.OLEDB.4.0;"
+@"data source=path.gdb";
OleDbConnection conn = new OleDbConnection(conString);
conn.Open();
OleDbCommand command = new OleDbCommand();
command = conn.CreateCommand();
DataSet ds = new DataSet();
conn.Open();
command.CommandText = "SELECT * FROM PrimaryCircuit";
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
adapter.Fill(ds);
dataGridView1.DataSource = ds;
Error :the Microsoft Jet database engine cannot open the file 'path.gdb'. It is already opened exclusively by another user, or you need permission to view its data.