Hi I have a problem here using .dbf files. I can make CRUD operations but i get an exception when i try to use transactions. I am doing like this:
public void AddRolesToUser(string user, string[] roles)
{
using (OdbcConnection connection = new OdbcConnection(ConnectionString))
{
OdbcCommand command = new OdbcCommand();
OdbcTransaction transaction = null;
command.Connection = connection;
try
{
connection.Open();
transaction = connection.BeginTransaction();
command.Connection = connection;
command.Transaction = transaction;
command.CommandText = "Delete From Roles Where User='" + user + "'";
command.ExecuteNonQuery();
if (roles != null)
{
foreach (string role in roles)
{
command.CommandText = "Insert Into Roles(User, Role) Values('" + user + "', '" + role + "')";
command.ExecuteNonQuery();
}
}
transaction.Commit();
}
catch(OdbcException ex)
{
transaction.Rollback();
}
}
}
When it hits connection.BeginTransaction() i get this exception
[Microsoft][ODBC dBase Driver]Optional feature not implemented
This is my connectionstring
"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;" + "Dbq=" + root + ";"
I repeat , i can make CRUD operations ok.