views:

18

answers:

1

I am using OLEDB to Update data in .dbf database from c#.

I get Error: System.Data.OleDb.OleDbException {"Undefined function 'replace' in expression."} on ExecuteNonQuery.

How can I make this work with least changes, i need to replace double quotes with single quotes in many files, so i have to automate this process.

Should I try ODBC or something else for .dbf database?

Help please!

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + directory +";Extended Properties=dBASE III;";
OleDbConnection conn = new OleDbConnection(connString);
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText = "update Addres_1  set NAME_ENU = replace(NAME_ENU, 'a',   'b') where NAME_ENU like '*a*'";
int res = cmd.ExecuteNonQuery();
A: 

Replace is not supported by used data provider. I will update answer if and when i find out how to do this in fast and simple way on large dataset.

watbywbarif