rated by 0 users
This post has 2 Replies | 2 Followers

Top 10 Contributor
Male
Posts 33
Md. Elias Hossain Posted: 01-02-2010 12:50 PM

   While using Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 SqlDataAdapter, we can fill dataset with the Fill() method passing dataset object which contains tables collection as multiple result according to the CommandText.

   We can retrieve/traverse among the result set using Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 SqlDataReader as bellow:

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

        using (SqlConnection objConnection = new SqlConnection(ConnectionString))

        {

            objConnection.Open();

            using (SqlCommand sqlCmd = new SqlCommand("sp_Custom_GetMultipleResultSet", objConnection))

            {

                SqlDataReader objFirstResultSet = sqlCmd.ExecuteReader();

                if (objFirstResultSet.NextResult())

                {

                    // Other operation code block here

                }

            }

        }

                   

Md. Elias Hossain
MCP, MCTS(WEB)
Software Engineer

Top 10 Contributor
Male
Posts 124

"sp_Custom_GetMultipleResultSet" is this a store procedure name?

"Excuse if any gaffe."

Md Nazmul Ahsan
Programmer (.NET Framework)
CIS, IADCS & DIT

Top 10 Contributor
Male
Posts 33

Yes, "sp_Custom_GetMultipleResultSet" is a stored procedure which contain multiple select statement.

 

Thanks

Md. Elias Hossain
MCP, MCTS(WEB)
Software Engineer

Page 1 of 1 (3 items) | RSS