Mobile Application
-
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..
-
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..
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 aNothing
.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007