Windows 7 64-bit. Trying to read text file with C#
ConnectionString
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=N:\TestFiles;Extended Properties="text;HDR=NO;FMT=Delimited(|)";
using(System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(ConnectionString))
{
conn.Open();
System.Data.OleDb.OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM [DataFile]";
string bc = (string)cmd.ExecuteScalar();
}
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll
Additional information: Cannot update. Database or object is read-only.
It looks like I have to modify DisabledExtensions at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Text
How can I add null file extension?