Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

sqldatareader in c#

SqlCommand myCMD = new SqlCommand("SELECT CategoryID, CategoryName FROM Categories;" + "SELECT EmployeeID, LastName FROM Employees", nwindConn);  
nwindConn.Open();  
SqlDataReader myReader = myCMD.ExecuteReader();  
do {  
    Console.WriteLine("	{0}	{1}", myReader.GetName(0), myReader.GetName(1));  
    while (myReader.Read()) Console.WriteLine("	{0}	{1}", myReader.GetInt32(0), myReader.GetString(1));  
}  
while (myReader.NextResult());  
myReader.Close();  
nwindConn.Close();  
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to restart flutter app programmatically 
Csharp :: list to array c# 
Csharp :: c# list of properties from list of objects 
Csharp :: set rotation unity 
Csharp :: c# add button to messagebox 
Csharp :: C# return and set multiple values from method 
Csharp :: remove duplicate characters in a string c# 
Csharp :: c# use api rest 
Csharp :: The foreach Loop c# 
Csharp :: check an enum containa an int or not in C# 
Csharp :: c# new list of objects 
Csharp :: c# get custom attribute from property 
Csharp :: convert-integer-to-binary-in-c-sharp 
Csharp :: c# template 
Csharp :: save image in c# 
Csharp :: unity rotate around axis 
Csharp :: c# numbers only 
Csharp :: c# handle single quote inside string 
Csharp :: unity rigid body variable 
Csharp :: c# get classes which inherits 
Csharp :: c# next level script 
Csharp :: meaning immutable and mutable 
Csharp :: asp.net core 6 autofac 
Csharp :: parametrizedthreadstart C# 
Csharp :: c# get assembly directory 
Csharp :: get device name c# console 
Csharp :: razor concatonate inline 
Csharp :: c# sum object values 
Csharp :: delay activity in uipath 
Csharp :: finding keys in the registry 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =