Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Editing a textbox
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Editing a textbox
Miscellaneous
Thread ID:
00917277
Message ID:
00917277
Views:
32
I would appreciate someone pointing me in the right direction. The text boxes are populated and I want to edit a text box.

1. Using SQL Server 2000, ASP.NET with VB.NET
2. Attempting to edit a record from a textbox.

Code used in CodeBehind page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here

        SqlDataAdapter1.Fill(dsCustomers.Customers)

        Dim drCity As DataRow
        Dim iCurrentrow As Integer

        drCity = dsCustomers.Tables("Customers").Rows(iCurrentrow)

        txtCity.Text = drCity("City")
        txtCountry.Text = drCity("Country")
        txtCompanyName.Text = drCity("CompanyName")

        Call DataBind()

    End Sub

    

    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click

        
' <b><i>The value from txtCity remains at the original entry... </b></i>

''''dsCustomers.Tables("Customers").Rows(0)("City") = txtCity.Text


' <b><i>You can delete the quotes and the record value will change - BUT - you have to click the save Button twice! </b></i>
 

      ''''dsCustomers.Tables("Customers").Rows(0)("City") = "Tester"

      dsCustomers.Tables("Customers").Rows(0)("City") = "Berlin"

      SqlDataAdapter1.Update(dsCustomers, "Customers")
        
    End Sub
End Class
Reading the available books and on line "examples" has not helped.

Tom
Next
Reply
Map
View

Click here to load this message in the networking platform