472,328 Members | 1,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 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 4481
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...
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...
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...
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...
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...
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...
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...
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...
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...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.