none
Making VB.net 2003 SqlDataAdapter work in vb.net 2005 RRS feed

  • Question

  • Converted an project from 2003 to 2005 and regenerated the dataset in 2005 and now get

    ! NullReferenceException was unhandled by user code {"Object reference not set to an instance of an object."}

    in me.sqldataadaper1.fill

     

    If Not Page.IsPostBack Then

    Me.Label1.Text = "Hello"

    Me.SqlDataAdapter1.Fill(Me.TealTeacher1, "teacher")

    Me.DataGrid1.DataBind()

    End If

     

     

    How do I resolve this?

    Thursday, October 25, 2007 2:15 PM

All replies

  • What is Me.TealTeacher1? Has this been defined somewhere in your code?

     

    Thursday, October 25, 2007 4:23 PM
  • Me.TealTeacher1 is a dataset in the  view component designer  that was created from a SqlDataAdapter with a SqlConnection, these were created in 2003.  Need to know how to make them work or convert them to work in vb .net 2005.  Thanks

     

    Tuesday, November 6, 2007 4:01 PM
  • It appears to work if I call Page_Init(sender, e) in the page_load then all works as before so far.

    This is probably not the best way to do this, if there is a better way to fix please let me know.

    Wednesday, December 5, 2007 7:39 PM