Hi All
I am using the VFPOLEDB provider. It has been a good "provider"! In the name of shorting code I am trying to use the count command/function to retrieve the rows found from a previous query. Here is my code
The initial query does indeed work - it returns rows. I have tried a number of constructs without success. I know there is an issue with the cnt = convert.toint32(rsult) statement. But the real issue is rsult is empty following the rsult = cmd1.ExecuteScalar().tostring statement. Any insights would be greatly appreciated.
Respectfully,
Ideprize
I am using the VFPOLEDB provider. It has been a good "provider"! In the name of shorting code I am trying to use the count command/function to retrieve the rows found from a previous query. Here is my code
VB.NET:
sqry = "select * from httrk where ht like 'j310'"
Dim fxcmd As New OleDbCommand(sqry, conn2)
Dim reader As OleDbDataReader = fxcmd.ExecuteReader()
Dim cnt As Integer
sqry = "SELECT ht, Count(ht) FROM httrk group by ht"
Dim rsult As String
Dim cmd1 = New OleDbCommand(sqry, conn2)
rsult = cmd1.ExecuteScalar().ToString
cnt = Convert.ToInt32(rsult)
The initial query does indeed work - it returns rows. I have tried a number of constructs without success. I know there is an issue with the cnt = convert.toint32(rsult) statement. But the real issue is rsult is empty following the rsult = cmd1.ExecuteScalar().tostring statement. Any insights would be greatly appreciated.
Respectfully,
Ideprize
Last edited by a moderator: