This is my code.

VB Code:
  1. Dim cn2 As New SqlClient.SqlConnection()
  2. cn2.ConnectionString = "Integrated Security=True;" & _
  3.         "Data Source=Brutus;Initial Catalog=Problem Tracking;" & _
  4.         "user id=user;password=pass;"
  5. cn2.Open()
  6. Dim commSQL2 As New SqlClient.SqlCommand()
  7. commSQL2.Connection = cn2
  8. Dim datRead2 As SqlClient.SqlDataReader
  9. commSQL2.CommandText = "Select Count(Store Number) As Exp1 From Stores Order By [Store Number]"
  10. datRead2 = commSQL2.ExecuteReader

This causes the following error message:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll

Additional information: System error.

I tried it with a regular Select command like this.
VB Code:
  1. commSQL2.CommandText = "Select [Store Number] From Stores Order By [Store Number]"
This worked fine.

Anyone have any ideas why the select count statement is not working?

Thanks