lovelyhelp 0 Newbie Poster

i am trying to create a guest book in asp.net...but i found a compilation error:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 42: ' Create a new row for the new guestbook entry
Line 43: Dim myDataRow As DataRow
Line 44: myDataRow = GuestbookEntriesTable.NewRow
Line 45:
Line 46: ' Set the row's data values


Source File: c:\inetpub\wwwroot\fyp\guestbook.aspx.vb Line: 44

what is the error be?
-----------------------------------------------------
Sub btnSignGuestbook_OnClick(ByVal sender As Object, ByVal e As EventArgs)
' Read our XML file into an XmlDataDocument so
' we can access it as a DataSet
Dim myXmlDataDocument As New XmlDataDocument()
myXmlDataDocument.DataSet.DataSetName = "Guestbook"
myXmlDataDocument.DataSet.ReadXmlSchema(strXmlSchema)
myXmlDataDocument.Load(strXmlDocument)

' Get a shorter name that points at our table to make things easier
Dim GuestbookEntriesTable As DataTable
GuestbookEntriesTable = myXmlDataDocument.Dataset.Tables("Entry")

' Create a new row for the new guestbook entry
Dim myDataRow As DataRow
myDataRow = GuestbookEntriesTable.NewRow

' Set the row's data values
myDataRow.Item("Name") = txtName.Text
myDataRow.Item("Date") = Now()
myDataRow.Item("Message") = txtMessage.Text

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.