What's wrong with this? I know i must have missed out something. But what's that i'm missing?

Dim ds As DataSet = New DataSet
        Dim da As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM Member WHERE MemberUserName = @MemberUserName", Conn)
        da.SelectCommand.Parameters.Add("@MemberUserName", SqlDbType.VarChar)



        da.SelectCommand.Parameters("@MemberUserName").Value = Session("Username")
 
        ' Fill DataSet with the data
        da.Fill(ds, "Member")
        Page.DataBind()

        txtbox_name.DataBind()
        txtbox_birthdate.DataBind()
        txtbox_nric.DataBind()
        txtbox_address.DataBind()
        txtbox_contact.DataBind()
        txtbox_email.DataBind()
        Page.DataBind()
        Conn.Close()

What's wrong with this? I know i must have missed out something. But what's that i'm missing?

Dim ds As DataSet = New DataSet
        Dim da As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM Member WHERE MemberUserName = @MemberUserName", Conn)
        da.SelectCommand.Parameters.Add("@MemberUserName", SqlDbType.VarChar)



        da.SelectCommand.Parameters("@MemberUserName").Value = Session("Username")
 
        ' Fill DataSet with the data
        da.Fill(ds, "Member")
        Page.DataBind()

        txtbox_name.DataBind()
        txtbox_birthdate.DataBind()
        txtbox_nric.DataBind()
        txtbox_address.DataBind()
        txtbox_contact.DataBind()
        txtbox_email.DataBind()
        Page.DataBind()
        Conn.Close()

hi,
before u are adding the databinding to textboxes u have to clear there binding. if u dont do this first time when u run ur application it works but the next time it nowt works.
so before
txtbox_name.DataBind()
txtbox_birthdate.DataBind()
txtbox_nric.DataBind()
txtbox_address.DataBind()
txtbox_contact.DataBind()
txtbox_email.DataBind()
this code u clear binding of all these text boxes

Hope this will help U
Neeraj trivedi

This article has been dead for over six months. Start a new discussion instead.