CommandType.TableDirect Is Not Supported by SqlCommand.CommandType. The System.Data.OleDb namespace supports it. It follows that the following form works:
string cnnStr = "Provider=SQLOLEDB; Server=(local); Database=pubs; Integrated Security=SSPI;";
using(OleDbConnection cnn = new OleDbConnection(cnnStr))
{
OleDbCommand cmd = null;
OleDbDataReader reader = null;
try
{
cnn.Open();
string tbl = "authors";
cmd = new OleDbCommand(tbl, cnn);
cmd.CommandType = CommandType.TableDirect;
reader = cmd.ExecuteReader();
//TODO: use reader.
}
finally
{
if ((reader != null) && (!reader.IsClosed))
{
reader.Close();
reader.Dispose();
}
if (cmd != null) cmd.Dispose();
}
}