473,385 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I refresh an in-memory table?

Hi,

I've got a global in-memory table which is kind of a control table for a lot
of processes. I've added quite a few non-persisted properties to the row
objects in memory, such as collections of threads, etc., which are
dynamically populated.

Here's my basic issue. I'd like to monitor the source table in the database
and pull in new rows that might have been created in different processes. I
don't want to just re-fill the data table, because I've got all these other
objects attached to the rows.

Anyway, I tried to do this with brute force. I created a new table, filled
it with the current data, looped through the rows till I found one that
wasn't in my in-memory global control table, and then...

well, what, exactly? C# wouldn't let me just add a row from one table to the
other, and there's no row.clone method. So I added a row by calling the
generated Add method whose signature contains a parameter for each field
value. But then when I tried to update the record (with a table adapter's
Update method, using the row as parameter), I got a "duplicate key" error.
Apparently, the table adapter is trying to insert a new record instead of
updating the old.

Well, I worked around this by *deleting* the original record after copying
it's info into the in-memory table, and then calling Update inserted a new
record without a key conflict. But this seems like the ugly way around. Is
there an easier or at least less klutzy way of doing this? Thanks.

--
Warren Sirota
www.wsdesigns.com
Dec 12 '06 #1
0 1729

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rick | last post by:
Hi folks, I have a web page I wrote for a class assignment (which I embellished a little) that doesn't seem to work on all browsers, platforms, etc. The problem appears to be that the page...
9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
4
by: Noel Wood | last post by:
Hello, I have a problem that I'm sure is simple but I have searched the newsgroup and have not found it posted before so I apologize if it has been asked heaps of times before. I have a page that...
3
by: Jack Wright | last post by:
Dear All, I would like to disable the Refresh events like (F5, Ctrl+R, RightClick Mouse + Refresh, Ctrl+N)... I have been able to solve F5 and RightClick Mouse + Refresh...how to I trap or ignore...
4
by: Tim::.. | last post by:
Can someone please tell me why the following dynamic refresh doesn't work! Thanks Inline code... <!----- dynamically filled META REFRESH element -----> <meta id="mtaRefresh" runat="server" />...
7
by: Brian | last post by:
hello, I am looking for a way to auto refresh a web page that I created, but also let the user choose to stop the auto refresh. I can not figure out how to stop the auto refresh. Any help would...
1
by: achoo | last post by:
Is it possible to extend a Web service proxy so that it understands an HTTP refresh page? Explanation: * The Web service proxy was autogenerated by Visual Studio .NET 2003 from the Web...
3
by: martin1 | last post by:
Hi, All, is there anyway to refresh window-based application every minute? it is like web-based application refresh by setting up <meta-equiv="refresh" content ="60">. Thanks
5
by: Kaante | last post by:
Hi, I basically have two frames on my page, the top one contains users stats and the bottom frame contains the website. I want to have a message icon on the top frame which would flash once the...
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hi all, i betcha here's a question never asked before ;) i have a simple web form with a gridview and a button. the button doesn't do anything but a postback. i load up the gridview from the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.