Solved

Value cannot be null

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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