.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

what is the difference between SqlDataReader.NextResult() and MARS

Posted By:      Posted Date: September 19, 2010    Points: 0   Category :ASP.Net


While i have been working with application perfomance tuning part i found an article for doing the same from Microsoft. it suggests me to reduce the round trip between application and database by using Sqlbatch statements. i got two ways to achieve it 

1. SqlDataReader.NextResult() - we can use single connection to execute sql batch statements

2. MARS (Multiple Active Result Sets) - we can use single connection to open multiple readers and execute the batch statements

MARS is having both advantages and disadvantages like Multiplexing and Thread Safety (no).

i like to know the difference between both of them , why do we need MARS instead of SQLReader.NextResult() while it solves our batch execution using a single connection?

View Complete Post

More Related Resource Links

What is the difference between "dynamic" and "object" keywords?

Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

.net difference between versions


 what is the difference between .net 2.0/3.0/ 3.5

Difference Btw Website vs Web application and Virtual directory in IIS 7


May i know what is the Differenc that they actually make in IIS7 .

Please tell me at a low level as i am still a novice in Asp.Net


Thanks in Advance.


sqlDataReader dos not get results


I am trying to run a stored proc from this function. When I run it thorugh the debugger I can see that myReader.HasRows = true and myReader.FieldCount =14.

But the control does not go in the loop while (myReader.Read()) where I am trying to read Version field returned by the stored proc.

Pls check me code and suggest correction. Thank You.

private static int Get_CaseInfo(string CaseNum)
            int Ver = 0;
            String myConn = ConfigurationManager.ConnectionStrings["DBConnectionString"].ToString();
            SqlConnection conn = new SqlConnection(myConn);
            SqlCommand cmd = new SqlCommand();
            cmd.CommandType = System.Data.CommandType.Text;

            SqlDataReader myReader = null;
            String stmt1 = "EXEC [REPORTS].[CaseInfoByCaseNo_Get] @CaseNo = '" + CaseNum + "'"; 
            cmd.CommandText = stmt1;
            cmd.Connection = conn;
                myReader = cmd.ExecuteReader();
                while (myReader.Read())
                    Ver = (int)myReader["Version"];

            catch (Exception)
            return Ver;         

Difference between normal DLL & .net DLL


Hi All,

What is a difference between a regular DLL & .net DLL ?

Thanks in adavnce

Don't Get Me Started: Mars and Venus


It's a fact that men and women don't think alike-remember this when designing software for the half of users that aren't like you.

David Platt

MSDN Magazine August 2010

Need function to find difference between two dates


Hi all

I need a function written in vb to find the exact month difference between two dates.

For example

    Start Date : 01/01/2010

    End Date   : 15/02/2010

 then the difference value should be like this 1.5  i.e i need the difference in decimal value.

difference between GetPostbackEventReference and GetCallbackEventReference



Hi All,

I was working with these two methods of ClientScriptManager class, but still not able to understand it properly.

Any one  have work on experience with these methods, want to know the difference between

GetPostbackEventReference and GetCallbackEventReference.

Friends, please dont post any urls. I also searching through different articles, but seened only definitions without any proper explained examples.

Time Difference in Linq queries


Hi All,


I have my Linq query in which i need to find time difference(not days difference).

The field in database is datetime.

Dim ldtToday As DateTime = TimeOfDay

Dim SR_RM_InnerJoin = From SR In lcntxRT60Entities.RtSReports _

Join RM In lcntxRT60Entities.RtRMaster On SR.RtRMaster.ReportID Equals RM.ReportID _

Select SR, RM _

Difference between String and string in C#



Can somebody explain to me the difference between String and string in C#?



difference between win 2003 Ent and Win 2008 Ent

what is difference between win 2003 Ent and win 2008 ent in clustering environment?

What is the difference in these two approaches of using SQL server databse?

Using - VS 2005, SQL Server 2005 Expresss, C# WinForms App What is the difference in these two approaches of using SQL server databse?   approach 1 -> directly connect to sql server and use an available, preexisting database   approach 2 -> add a SQL Database file to ur WinForm app and connect to it Are these things right abt these alternatives?  - approach 2 means SQL Server CE database  - approach 2 will b better for deployment as databse file will reside in app folder. i m new to SQL Server. I used to worrk with ms access only. Please help?Vibhor Agarwal

What is the difference between component,tier and layer?

We often heard about these word  like component, tier, layer of an asp.net application. Please explain the difference between  component , tier and layer?We often heard about these word  like component, tier, layer of an asp.net application.Please explain the difference between  component , tier and layer?

Difference between Rating and RatingExtender control in ajax control toolkit

Hi, Can you tell the difference between Rating and RatingExtender asp.net ajax Control ? 

Difference .net 2.0, 3.0 and 3.5

What is the difference between .net 2.0 & .net 3.0 and .net 2.0 and .net 3.0   Regards, Arvind Robin Kumar.

What is the difference between Server.Transfer & response.Redirect()

Hello Friends,This is the very favourate question available on every interview questions site.I have searched for it. But didnt get the satisfactory practical difference between these two.Please show me the difference between this two through a working sample demo.Please ilustrate it through a simple sample.

SQLDataAdapter/SQLDataReader takes lot of time for executing a query

All, I have a webpage with 6 drop down lists. User can start with selecting any drop down list first, and then proceed in any order.  1. Assume when the 1st dropdown is selected first, rest 5 drop downs (except 1st) are filtered/updated based on the selected value in the 1st dropdown. 2. Assume user selects the 4th dropdown second, rest 5 drop downs (except 4th) will be filtered/updated but the condition would be based on both 1st drop down and 4th drop down. But while filtering the first drop down, only the 4th drop down is used as filter (self-filter will be ignored). The code works fine but I see a very bad performance hit in time when the user selects the fourth dropdown after selecting three drop downs. I tried using both SQLDataAdapter and SQLDataReader but neither used to solve the issue. The code takes a lot of time on one line in either of the code (which is highlighted below). When I run the query in SQLServer Mgmt Studio, the query completes in a few seconds.Using SQLDataReader: SqlConnection conn = new SqlConnection(CONNECTION); SqlCommand ObjCmd = new SqlCommand(query, conn); ObjCmd.CommandTimeout = 600; conn.Open(); SqlDataReader daSelTools = ObjCmd.ExecuteReader(); //This line takes a lot of time ddl.Items.Clear(); // Call Read before accessing data. while (daSelTools.Read()) { ddl.Items.Add(new ListItem(String.Format("{0}",daSelTools[0])));
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend