Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Mobile Application

Mobile Application

Scheduled Pinned Locked Moved Visual Basic
helpdatabasedebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Usharva
    wrote on last edited by
    #1

    Hi friends i am creating a mobile application.. i created a dataset through the Wizard.. i had given a parameter in the select statement. Now i want to pass the value of the parameter my query in wizard is: SELECT reg_Id, PatientRegId, pat_name, DOB, Age, Gender FROM PatientRegistration WHERE (PatientRegId = @PatID) in normal applications i use to pass like sqldataadapter.selectcommand.parameter("@PatId").value=10 but in mobile application its not accepting the above format.. i tried in many ways finally i got the below code PatientRegistrationTableAdapter.FillBy(MobilehealthcareDataSet1.Tables("Pat", "PatientRegistration"), Val(TextBox1.Text)) Note: PatientRegistration is table name but i am getting the error like: "Null Refernece Exception" when i debug and go inside the above method in .designer.vb (below code) Public Overloads Overridable Function FillBy(ByVal dataTable As mobilehealthcareDataSet6.PatientRegistrationDataTable, ByVal PatID As Integer) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(1) Me.Adapter.SelectCommand.Parameters(0).Value = PatID If (Me.ClearBeforeFill = true) Then ' dataTable.Clear End If <b>Dim returnValue As Integer = Me.Adapter.Fill(dataTable) </b>Return returnValue End Function now i got the error like " "Value can not be null. Parameter name: dataTable " if anyone knows please help me..

    D 1 Reply Last reply
    0
    • U Usharva

      Hi friends i am creating a mobile application.. i created a dataset through the Wizard.. i had given a parameter in the select statement. Now i want to pass the value of the parameter my query in wizard is: SELECT reg_Id, PatientRegId, pat_name, DOB, Age, Gender FROM PatientRegistration WHERE (PatientRegId = @PatID) in normal applications i use to pass like sqldataadapter.selectcommand.parameter("@PatId").value=10 but in mobile application its not accepting the above format.. i tried in many ways finally i got the below code PatientRegistrationTableAdapter.FillBy(MobilehealthcareDataSet1.Tables("Pat", "PatientRegistration"), Val(TextBox1.Text)) Note: PatientRegistration is table name but i am getting the error like: "Null Refernece Exception" when i debug and go inside the above method in .designer.vb (below code) Public Overloads Overridable Function FillBy(ByVal dataTable As mobilehealthcareDataSet6.PatientRegistrationDataTable, ByVal PatID As Integer) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(1) Me.Adapter.SelectCommand.Parameters(0).Value = PatID If (Me.ClearBeforeFill = true) Then ' dataTable.Clear End If <b>Dim returnValue As Integer = Me.Adapter.Fill(dataTable) </b>Return returnValue End Function now i got the error like " "Value can not be null. Parameter name: dataTable " if anyone knows please help me..

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Usharva wrote:

      Public Overloads Overridable Function FillBy(ByVal dataTable As mobilehealthcareDataSet6.PatientRegistrationDataTable, ByVal PatID As Integer) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(1) Me.Adapter.SelectCommand.Parameters(0).Value = PatID If (Me.ClearBeforeFill = true) Then ' dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function

      This is simple. The code that calls this method isn't passing in an INSTANTIATED PatientRegistrationDataTable object. The code is passing in a Nothing.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups