System error in Windows Application datagrid
I need to get Sql server data and populate in datagrid (a windows application).
I got a Microsoft Development Environment error message on dataAdapter.Fill(dataSet, "Sales")
: An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll. Additional information: System error.'
Can someone help me out of it! Thank you in advance.
--------------------------
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click
Dim strSql As New SqlCommand
Dim dataSet As New DataSet
conDWDb.Open()
strSql.Connection = conDWDb
strSql.CommandText = "Select * from micros.Operations where store_num=@StoreNum and store_mgr is not null"
strSql.Parameters.Add("@StoreNum", txtStoreNum.Text)
Dim dataAdapter As New SqlDataAdapter(strSql)
dataAdapter.Fill(dataSet, "Sales")
SalesGrid.DataSource = dataSet.DefaultViewManager
conDWDb.Close()
End Sub

