|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
I am getting this error:
An unhandled exception of type 'System.NullReferenceException' occurred in 8.exe Additional information: Object reference not set to an instance of an object. Which points at this piece of code: DBCareerAdapter.SelectCommand.CommandText = strSelect & _ strWhere & CStr(intminatbats) & " " & _ strOrderBy Can anyone tell me what the error means or point me in the right direction? My strings are not empty...and I have delcared the adapter beforehand. Thanks |
|
#2
|
||||
|
||||
|
1) This belongs in the .NET area of the forum
2) It would help if you told us what strSelect and strWhere was? 3) Quote:
Means that you are trying to reference an object that you haven't instantiated. Example This will throw the above error Code:
Declare the variable as a type Dim x As Object You can't do this because you haven't created the object yet. x.Property = Value This will work Code:
Declare the variable as a type Dim x As Object Instantiate it (create it) x = New Object x.Property = Value |
|
#3
|
|||
|
|||
|
1.) Sorry
2.) I have the strselect and where defined right above DBCareerAdapter.SelectCommand.CommandText = strSelect & _ strWhere & CStr(intminatbats) & " " & _ strOrderBy Then before the strselect and where i have the adapter defined as Dim DBCareerAdapter AsNew OleDb.OleDbDataAdapter thanks for your help |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Database Adapter Error in VB.NET |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|