data binding

winnie

Member
Joined
Nov 27, 2002
Messages
12
hi. i am using vb.net and sql
i have problems with databinding.

here is the scenario:

when i click on a link, i can read and delete data from the database.
when i click on the link for the second time, the data will multiply itself.
for example, if the first time there are 2 data, the second time will become 4 data. and so on.

what is the problem here??
any help?
thanks.
 
Its really tough to tell without knowing how youre doing things. My guess would be youre letting the dataset get out of sync with the database. Are you accepting changes from the dataset after updating? Maybe you could post the relevant code?
 
yes, i am accepting changes from the dataset after updating.

here are the coding where i call the db.
Code:
tbI1.DataBindings.Clear()
tbI2.DataBindings.Clear()
tbI3.DataBindings.Clear()

cmdServer_Storage = connsms.CreateCommand
cmdServer_Storage.CommandText = "SELECT * FROM dbo.Server_Storage "

daServer_Storage.SelectCommand = cmdServer_Storage

Dim cb As SqlCommandBuilder = New SqlCommandBuilder(daServer_Storage)
daServer_Storage.Fill(dsServer_Storage, "Server_Storage")

tbI1.DataBindings.Add("Text", dsServer_Storage.Tables(0), "Date_Send")
tbI1.Visible = False

tbI2.DataBindings.Add("Text", dsServer_Storage.Tables(0), "Receiver_ID")
tbI2.Visible = False

tbI3.DataBindings.Add("Text", dsServer_Storage.Tables(0), "Message")
tbI3.Visible = False

txtInbox.Text = tbI1.Text & vbCrLf + tbI2.Text & vbCrLf + tbI3.Text
[edit]added VB tags[/edit]
tb1,tb2 and tb3 are textbox. i set it become invisible because i want to display all the data into one textbox (txtInbox) .
can i display the data this way?

are there any errors in the code or did i left out anything??

thanks a lot.
 
Last edited by a moderator:
Back
Top