'Declaration Public Overloads Shadows Function ExecuteReader() As SugarDataReader
public new SugarDataReader ExecuteReader()
Return Value
A SugarDataReader object.
'Declaration Public Overloads Shadows Function ExecuteReader() As SugarDataReader
public new SugarDataReader ExecuteReader()
public void CreateSugarDataReader(string mySelectQuery,string sugarConnectionString) { SugarConnection sugarConnection = new SugarConnection(sugarConnectionString); SugarCommand sugarCommand = new SugarCommand(mySelectQuery, sugarConnection); sugarCommand.Connection.Open(); SugarDataReader sugarReader = sugarCommand.ExecuteReader(); try { while(sugarReader.Read()) { Console.WriteLine(sugarReader.GetString(0)); } } finally { sugarReader.Close(); sugarConnection.Close(); } }
Public Sub CreateSugarDataReader(mySelectQuery As String, _ sugarConnectionString As String) Dim sugarConnection As New SugarConnection(sugarConnectionString) Dim sugarCommand As New SugarCommand(mySelectQuery, sugarConnection) sugarCommand.Connection.Open() Dim sugarReader As SugarDataReader = sugarCommand.ExecuteReader() Try While sugarReader.Read() Console.WriteLine(sugarReader.GetString(0)) End While Finally sugarReader.Close() sugarConnection.Close() End Try End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2