How to read multiple resultset from SqlDataReader? [duplicate]

Here you have a sample about how to handle multiple result sets with a data reader static void RetrieveMultipleResults(SqlConnection connection) { using (connection) { SqlCommand command = new SqlCommand( “SELECT CategoryID, CategoryName FROM dbo.Categories;” + “SELECT EmployeeID, LastName FROM dbo.Employees”, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); do { Console.WriteLine(“\t{0}\t{1}”, reader.GetName(0), reader.GetName(1)); while (reader.Read()) { Console.WriteLine(“\t{0}\t{1}”, … Read more

Dapper.NET and stored proc with multiple result sets

QueryMultiple supports the ability to deal with multiple result sets. The only design restriction we added was totally disabling buffering for the grid reader. This means the whole API is streaming. In the simplest case you can use: var grid = connection.QueryMultiple(“select 1 select 2”); grid.Read<int>().First().IsEqualTo(1); grid.Read<int>().First().IsEqualTo(2); In the slightly more sophisticated case you can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)