MeanMachine
Apr 29th, 2007, 10:05 AM
Hello All!
I'm a VB .NET programmer but I'm also doing some C# code as well. Could someone show me some code examples of how Data Readers are looped?
Here's how I do this in VB .NET:
con.Open 'Open connection
dr = com.ExecuteReader 'Use Command to Execute Reader
Do While dr.Read
ComboBox.Items.Add(dr!CustomerID) 'Read field Customer ID Key
End Loop
con.Close
con = Nothing 'Release object
Here's some of the understanding of C# sharp so far:
con.Open;
dr = com.ExecuteReader;
do while dr.Read :confused:
// Method here? :confused:
con.Close :confused:
I'm a VB .NET programmer but I'm also doing some C# code as well. Could someone show me some code examples of how Data Readers are looped?
Here's how I do this in VB .NET:
con.Open 'Open connection
dr = com.ExecuteReader 'Use Command to Execute Reader
Do While dr.Read
ComboBox.Items.Add(dr!CustomerID) 'Read field Customer ID Key
End Loop
con.Close
con = Nothing 'Release object
Here's some of the understanding of C# sharp so far:
con.Open;
dr = com.ExecuteReader;
do while dr.Read :confused:
// Method here? :confused:
con.Close :confused: