SqlClient GetData Method Nemiro.Data.dll
Executes the query and returns DataSet. This method is used in conjunction with the properties CommandType, CommandText and Parameters.

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

public DataSet GetData()

Return Value

Type: DataSet
Exceptions

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

using (SqlClient c = new SqlClient())
{
  c.CommandText = "SELECT * FROM messages; SELECT * FROM users;";
  DataSet data = c.GetData();
  if(data.Tables.Count > 0)
  {
    foreach(DataTable t in data.Tables)
    {
      foreach(DataRow r in table.Rows)
      {
        Console.WriteLine("id = {0}", r["id"]);
      }
    }
  }
}
See Also