The following example creates a
ZohoDeskCommand, then executes it by passing a string that is SQL SELECT statement, and a string to use to connect to the data source.
|
|---|
public void CreateZohoDeskDataReader(string mySelectQuery,string ZohoDeskConnectionString)
{
ZohoDeskConnection ZohoDeskConnection = new ZohoDeskConnection(ZohoDeskConnectionString);
ZohoDeskCommand ZohoDeskCommand = new ZohoDeskCommand(mySelectQuery, ZohoDeskConnection);
ZohoDeskCommand.Connection.Open();
ZohoDeskDataReader ZohoDeskReader = ZohoDeskCommand.ExecuteReader();
try
{
while(ZohoDeskReader.Read())
{
Console.WriteLine(ZohoDeskReader.GetString(0));
}
}
finally
{
ZohoDeskReader.Close();
ZohoDeskConnection.Close();
}
} |
|
|---|
Public Sub CreateZohoDeskDataReader(mySelectQuery As String, _
ZohoDeskConnectionString As String)
Dim ZohoDeskConnection As New ZohoDeskConnection(ZohoDeskConnectionString)
Dim ZohoDeskCommand As New ZohoDeskCommand(mySelectQuery, ZohoDeskConnection)
ZohoDeskCommand.Connection.Open()
Dim ZohoDeskReader As ZohoDeskDataReader = ZohoDeskCommand.ExecuteReader()
Try
While ZohoDeskReader.Read()
Console.WriteLine(ZohoDeskReader.GetString(0))
End While
Finally
ZohoDeskReader.Close()
ZohoDeskConnection.Close()
End Try
End Sub |