Form to Form

rex028

Well-known member
Joined
Nov 18, 2004
Messages
50
Programming Experience
Beginner
VB.NET:
 Dim pomain As New PurchaseOrder
	Dim objDS2 As Data.DataSet
	Dim objUser As New clsPO

	Private Sub poAddItem_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		GetItemDetails()
	End Sub

	Private Sub GetItemDetails()

		objDS2.Clear()

		objDS2 = objUser.Search_tblUser("Select * from tbl_ITEM where Item_Type = '" & pomain.cboPOItemType.Text & "'")

		Try
			dg.DataSource = objDS2.Tables(0)


		Catch ex As Exception

		End Try
	End Sub
End Class

i got this error :
An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exe
Additional information: Object reference not set to an instance of an object.

what's happen ???
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
i'm not 100% sure (cause i'm not very familiar with datasets) but i think you need to change this line:

Dim objDS2 As Data.DataSet

to

Dim objDS2 As New Data.DataSet
 
Top Bottom