Dataset problem

Posted on 2005-03-31
Medium Priority
Last Modified: 2008-03-04

 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Introducir aquí el código de usuario para inicializar la página
        menu2.tipo = 3
        If Not Page.IsPostBack Then
        End If
    End Sub

    Private Sub cargarinfobasica()
        lbltotal.Text = Session("totalcartera")
        lblnombre.Text = Session("nombrecliente")
    End Sub
    Private Sub cargartotalesciudadxnit()
        Dim ds As DataSet
        ds = objconsultas.totalxicudadxnit(Session("nitproveedor"))
        dgtotalesxciudad.DataSource = ds.Tables("Totales").DefaultView
    End Sub

    Public Function totalxicudadxnit(ByVal nit As String) As DataSet
        Dim objconn As New OleDbConnection
        objconn = cn.conndb2oledb()
        Dim sqlad As New OleDbDataAdapter("select * from temp.totalxnitxciudad  where nit=?", objconn)
        sqlad.SelectCommand.Parameters.Add("NITPROVEEDOR", nit)
        Dim ds As DataSet
        sqlad.Fill(ds, "Totales")
        Return ds
    End Function


El valor no puede ser nulo. Nombre del parámetro: dataSet
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.

Detalles de la excepción: System.ArgumentNullException: El valor no puede ser nulo. Nombre del parámetro: dataSet

Error de código fuente:

Línea 43:         sqlad.SelectCommand.Parameters.Add("NITPROVEEDOR", nit)
Línea 44:         Dim ds As DataSet
Línea 45:         sqlad.Fill(ds, "Totales")  ----HERE-
Línea 46:         Return ds
Línea 47:     End Function
Question by:djhex
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
  • 2
LVL 11

Expert Comment

ID: 13677307
try to send Session("nitproveedor").Tostring() as parameter.
It should work.


LVL 11

Accepted Solution

sachiek earned 2000 total points
ID: 13677310
If not before you are calling your bind method try to creating a new instance dataset.

ds = new DataSet()
ds = objconsultas.totalxicudadxnit(Session("nitproveedor").ToString())

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

777 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