Solved

Value cannot be null

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

929 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