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

Thread Safety, dataset and dataview, ASP.NET

I according to MSDN dataview and dataset are thread safe for read
operations, but we run into this scenario. I just would like to see some
comments on it.
Aplication written in VB.NET it is an ASP.NET app.
located on busy web server.

Initially we defined dataview slightly wrong and run into the problem.

we have dataset cached which has large ammount of data.
sub Page_Load()
DisplayMyData()
end sub

Private sub DisplayMyData()
Dim ds as dataset=cache("Mydataset")

'this declaration caused a problem
dim dv as dataview=ds.tables("Mytable").defaultView

dv.rowfilter="My expression"

mydatagrid.datasourse=dv
mydatagrid.databind()
end Sub

ok, now during busy hours we had instead of several items, whole table
binded to datagrid. on refresh it was gone and everything worked fine.

problem was fixed when dataview was defind like this
dim dv as new dataview(ds.tables("Mytable"))
I understend why sometime we had whole table binded to datagrid, probably
when I tried bind dataview to datagrid, someone called that page and
dataview was changed to table.defaultview.

How this can be? dataview is not shared, sub is private
dataset is a shared object. Each user should have its own dataview and
reference to dataset.
Jul 21 '05 #1
1 4561
Arthur Dzhelali <a.********@theday.com> wrote:

<snip>
How this can be? dataview is not shared, sub is private
dataset is a shared object. Each user should have its own dataview and
reference to dataset.
No, everyone would be sharing the same DataView because they're all
using the default one for the table in the line:
dim dv as dataview=ds.tables("Mytable").defaultView

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

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

Similar topics

3
by: Alex Ayzin | last post by:
Hi, I have a problem that might be easy to solve(possibly, I've just overlooked an easy solution). Here we go: I have a dataset with 2 datatables in it. Now, I need to do the following: if...
4
by: suzy | last post by:
hello. how can i sort data in a dataset? all the examples i have seen on msdn, etc are sorting a dataview. this works fine, but i want to return the results in xml and the dataview doesn't...
1
by: Arjen | last post by:
Hi, What are the main differences between a dataset and a dataview? What should I cache dataset or dataview... or what is the best thing to do in what situation? Thanks! Arjen
2
by: Dennis | last post by:
Hi, I am hoping I can get some help with a small problem I have run into using C#. U have an XML file that I load into a Dataset and then display this in a Datagrid. No problems doing this at all....
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
3
by: Freeon | last post by:
Hi, I am looking for a way to sort a strong typed dataset. It would seem the most straightforward way is to use a dataview. The only problem is when I use the dataview I seem to loose the strong...
1
by: Arthur Dzhelali | last post by:
I according to MSDN dataview and dataset are thread safe for read operations, but we run into this scenario. I just would like to see some comments on it. Aplication written in VB.NET it is an...
1
by: rn5a | last post by:
I was using a DataView to bind records from a DB table to a DataGrid using the following code: Dim sqlDapter As SqlDataAdapter Dim dSet As DataSet Dim dView As DataView sqlDapter = New...
11
by: Sid Price | last post by:
I have Dataset that I need to filter into another Dataset for display and I can not find out how to do this. I have found methods for copying a Dataset but I can not see how to filter the rows...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.