0

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()
2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by neerajtrivedi
0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.