I know this is an old post but I would like to explain something here, right now it seems like current provider does not support SQL for this reason the connectionString should contain the Folder where your .sas7bdat file is. and then when creating the command you need to specify the actual table name without include the file extension. e.g DataSet sasDs = new DataSet();
String sasLibrary = @"D\SomeFolder\";
OleDbConnection connection= new OleDbConnection("Provider=sas.LocalProvider; Data Source=" + sasLibrary);
connection.Open();
OleDbCommand cmd= connection.CreateCommand();
cmd.CommandType = CommandType.TableDirect;
cmd.CommandText = "TableName";
//other option is to use the cmd.ExecuteReader();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(sasDs);
//sasDs should contain the DataTable loaded at this point.
//you can filter the results using the DataTable.Select()
connection.Close();
... View more