Value cannot be null
Posted on 2006-06-28
I am having a problem with populating a dataset. The query is as follows :
SQL$ = ""
SQL$ = SQL$ & " select glpd_sequence "
SQL$ = SQL$ & " from gl_period "
SQL$ = SQL$ & " where glpd_key = " & Me.ddl_glperiod.SelectedItem.Value
myCommand = New SqlCommand(SQL$, myConnection)
sqlAdapter = New SqlDataAdapter(myCommand)
glpd_key is a integer. When i run the query i get the following message : Value cannot be null. Parameter name: dataSet
I have tried to CAST glpd_key to varchar but i still get the error. If i use the query that is populating in the immediate window it runs fine on SQL Server
Can someone help please ....