Solved

Value cannot be null

Posted on 2006-06-28
1
193 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now