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 |