Articles → ADO.NET → MARS in ADO.NET

MARS in ADO.NET













		
MultipleActiveResultSets = False(or true) 
	   










Column NameData Type
ContentIDint
ContentDisplayName   varchar(50)
IsActivebool




Column NameData Type
ContentTypeID   int
ContentType   varchar(50)






		
string connectionString = "Server = TestServer;Database = test_delete;User ID = sa;Password = sa;Trusted_Connection = False;MultipleActiveResultSets = True";
	   






		
string content = "select top 1 * from tblContent";

string contenttype = "select top 1 * from tblContentType";
	   




		
using (SqlConnection conn = new SqlConnection(connectionString))
	   




		
conn.Open();
	   




		
SqlCommand cmdContent = new SqlCommand(content, conn);

SqlCommand cmdContentType = new SqlCommand(contenttype, conn);
	   




		
using (SqlDataReader rdContent = cmdContent.ExecuteReader())
	   




		
while (rdContent.Read())
	   




		
SqlDataReader rdcontentType = cmdContentType.ExecuteReader();
	   




		
while (rdcontentType.Read())
	   









Posted By  -  Karan Gupta
 
Posted On  -  Saturday, August 21, 2010

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250