Solved

Value cannot be null

Posted on 2006-06-28
1
195 Views
Last Modified: 2010-04-23
Hi there,

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)
        sqlAdapter.Fill(myDataSet)

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 ....
0
Comment
Question by:venterm
1 Comment
 
LVL 41

Accepted Solution

by:
graye earned 250 total points
ID: 17001406
you just need to add

myDataSet = New DataSet
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.Net How to Exit Sub - Exit Form??? 5 60
Put window Form inside tab page 10 33
Set value of dynamically created checkboxlist 2 35
RLDC Reporting in Visual studio 11 17
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question