473,322 Members | 1,345 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,322 software developers and data experts.

how can I deal with dataview

1
In my project. I have two DataTables: DTA,DTB.
I try do:
Dataview view=new dataview(DTA);
datagridview1.datasoruce=view;
view=new dataview(DTB);
datagridview2.datasource=view.

I found both datagridview1 and datagridview2 are working. the datagirdview1 still display the data in DTA and datagridview2 display the datat in DTB.
I think after I set view=new dataview(DTB), the dataview still exists that created by Dataview view=new dataview(DTA); how could I release this dataview when I don't need it? thank you.

Otherwise DTA will have many dataview when I load the page many times.
Apr 20 '09 #1
2 1184
from my understanding of it, the view variable refers to one object at a time when you assign it to the new object (new Dataview(DTB)) its no longer referring to the first object
Apr 20 '09 #2
ram09
45
you can insert this:
view.Table.Clear();

before you insert a new data table into your view.. this will clear all the datatables inside your dataview...
Apr 21 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: RPI_alum | last post by:
I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug ...
9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
3
by: astro | last post by:
I have a datagrid that is two levels down from the dataview (i.e. grandchild). I have spent 3 hours trying to get the syntax of determining it's real datasource (i.e. not it's source based on it's...
5
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a...
0
by: Pravin Pujari | last post by:
Hi All, I am using .net framework 1.1 and c#. I have one problem regarding dataview. I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.