SqlClient GetTable Method (String)Nemiro.Data.dll
Executes the query and returns DataTable.

Namespace: Nemiro.Data.Sql
Assembly: Nemiro.Data (in Nemiro.Data.dll) Version: 2.11.4.126 (2.11.4.126)
Syntax

public DataTable GetTable(
	string sql
)

Parameters

sql
Type: System String
Query SQL, to be executed.

Return Value

Type: DataTable
Exceptions

ExceptionCondition
SqlExceptionThe exception that is thrown when SQL Server returns a warning or error.
Examples

using (SqlClient c = new SqlClient())
{
  DataTable table = c.GetTable("SELECT * FROM users;");
  foreach(DataRow row in table.Rows)
  {
    Console.WriteLine("login = {0}", row["login"]);
  }
}
See Also