Hi,

I am creating a online visitor tracking application in vb.net. This application tracks the visitor from my website and display records in my application.

All the records are carry with xml web services [nusoap]. This Xml is bind to my datagridview control. Every time [on timer tick event] web services generate xml and bind to datagridview. This way i need to clean my datadgidview rows and re-bind again. so that i have lost my selection and order.

Is there any way so that i can update my datagridview rows or can say cell value without clean rows.

Thanks

Can you show us what you are doing?

I can't figure out why you would unbind.

Hi,

The Scenario is..

I called a web service which return me XML (return type string). Then i bind this XML to datagridview.

Ex. XML

<visitor>
<visitorIP>127.0.0.1</visitorIP>
<host>Some Host</host>
</visitor>

The code i am using..

Dim dataVL as String
dataVL = webservice.loadVisitors() ' web service call

Dim ds As New DataSet
Dim stringReader As New StringReader(dataVL)
ds.ReadXml(stringReader)

datagridview.SetDataBinding(ds.Tables(0), "")

This way the rows is datagridview bind again and again.. and alwaya i lost my selection and order..

I want to update only specific call values / rows from XML.
I don't want to reload all rows.

The web service calls on timer tick event (3 seconds) place inside backgroundworker.

Why don't you create a new dataset to bind to datagridview and merge ds into it?

i try to as u told above. But during merge new rows has added instead of updating old rows.

And I'm guessing that we don't want that?
So you want to update host name and keep the IP same in your example xml?

YES ;)
Exactly that i want.

I don't have a clue how to do it with datasets.
If I had to do it (without using SQL)I'd go with datatable and find using the IP address. If I got a result, I'd update the host name if not I'd add a row.

If you put SQL in the picture it's a walk to the park.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.