?
Solved

Updating rows in memory DataTable

Posted on 2003-10-24
3
Medium Priority
?
412 Views
Last Modified: 2010-04-16
Hi,

I'm interesting if its posible to update row of DataTable with new data.

I'm creating table:

DataTable OutTable=new DataTable("IndexTicker");
.
.
.
After I insert rows in table I want to update every 10 secound data
in table with new index data. Primary colomn is IndexCode.

Any idea?

Thanks
Tomaz
0
Comment
Question by:tomazsr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:zrh
ID: 9618713
Is this an ASP.NET application, or a Windows Forms application.
The direction to go depends greatly on which of these your writing for.

ZRH
0
 
LVL 1

Author Comment

by:tomazsr
ID: 9619966
Windows form application that use Web Services and I want that
requery on web services (lasts 3-5 secound) run in separate thread.

Tomaz
0
 
LVL 6

Accepted Solution

by:
zrh earned 750 total points
ID: 9631566
Try using the System.Timers.Timer component.
Set the Interval to be 6 seconds to make update ~10 seconds (9 to 11sec.)
Handle the Timer.Elapsed event.
In the method handling the Timer.Elapsed event, query the webservice, get the data.
Find the row using:
DataRow[] rows = OutTable.Select("IndexCode = " + IndexCodeOfRowToUpdate);
if(rows.Length == 1) { // If one row match found
    DataRow r = (DataRow)rows.GetValue(0);
    r["columnName"] = webServiceDataForColumnName;
    ...
    ...
}

NOTE: This would only allow updating of one row (one selected in datagrid maybe?) every ten seconds,
          did you want to update each row on its own 10sec interval starting from when added? (little more complicated)

I think this is what you want.
ZRH
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question