Articles → ADO.NET → MARS In Ado.Net

MARS In Ado.Net













MultipleActiveResultSets = False(or true)










Column NameData Type
ContentIDint
ContentDisplayNamevarchar(50)
IsActivebool




Column NameData Type
ContentTypeIDint
ContentTypevarchar(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