Solved

Value cannot be null

Posted on 2006-06-28
1
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

630 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