Datenbankzugriff mit .NET

Datenbankzugriffe mit .NET

var connstring = "";
DataSet ds = new DataSet();

using (SqlConnection con = new SqlConnection(connstring))
{
        con.Open();

        using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand())
        {
                cmd.CommandText = "myMultipleTablesSP";
                cmd.Connection = con;
                cmd.CommandType = CommandType.StoredProcedure;

                System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(cmd);


                adapter.Fill(ds);

        }
}

DataTable tableA = ds.Tables[0];
DataTable tableB = ds.Tables[1];