Issue a command that returns a single complete result set.
For C#:
AseConnection conn = new AseConnection( "Data Source='mango';" + "Port=5000;" + "UID='sa';" + "PWD='';" + "Database='pubs2';" );
For Visual Basic .NET:
Dim conn As New AseConnection( _ "Data Source='mango';" + _ "Port=5000;" + _ "UID='sa';" + _ "PWD='';" + _ "Database='pubs2';")
where “mango” is the name of the database server.
conn.Open();
conn.Open()
AseCommand cmd = new AseCommand( "select count(*) from authors where state = 'CA'", conn );
Dim cmd As New AseCommand( "select count(*) from authors where state = 'CA'"_, conn );
int count = (int) cmd.ExecuteScalar();
Dim count As Integer = cmd.ExecuteScalar()
conn.Close();
conn.Close()
When using the AseDataReader, there are several Get methods available that you can use to return the results in the desired datatype.