473,398 Members | 2,368 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,398 software developers and data experts.

DataSets in ASP.NET 2.0

Is there any way to drag & drop a DataSet or DataTable in a Web Form to link
it visually to a gridview, as it was done in ASP.NET 1.1? I can't fnd those
components in the toolbox, and I have tried to add them to it without
success.

I've been able to add a DataTable object as a member of the Web Form class,
and Bind it by using code (myGridView.DataSource = myDataTable,
myGridView.DataBind) But I don't have wizard support to configure the
columns, create the item templates and so on, so all that must be done
without help.

I now I can drop an ObjectDataSource to link directly to it, but, if I do
so, I can't modify the Dataset and keep it in Session to reuse it later.
What I'm trying to do is make several changes to the dataset (in several
postbacks), and when I decide everything it's right, update the changes in
the server. The ObjectDataSource forces me to post the changes to the DB
right when I make a single change in the gridview

If I want my GridView to allow me to do changes, and it's bound to an
ObjectDataSource, which it's in turn bound to my Business objects, it forces
me to implement methods for updating, inserting and deleting in my Business
Layer classes, so my only option is to post the changes to the database or
they're lost because I don't have access to the Page's Session object or any
other store which survives postbacks.

Am I missing something?

Thanks for your time.
Jun 9 '06 #1
4 1758
> I now I can drop an ObjectDataSource to link directly to it, but, if I
do so, I can't modify the Dataset and keep it in Session to reuse it
later. What I'm trying to do is make several changes to the dataset
(in several postbacks), and when I decide everything it's right,
update the changes in the server. The ObjectDataSource forces me to
post the changes to the DB right when I make a single change in the
gridview


Change the code in the data access class to store the DataTable/DataSet in
Session (or in the cache).

-Brock
http://staff.develop.com/ballen
Jun 9 '06 #2
Thank you very much for your help, but this doesn't solve my problem. I
think I'm missing something, but I can't find the way to access the Page's
Session object from my DAL or BLL clasess. How can I do it?

I've tried to instantiate my Business Layer Class in the web form, so that I
can keep it in Session, but then I can't connect the ObjectDataSource to
this objet.

I've also tried to create a DataSet/DataTable in the apge, but then again, I
can't connect the ObjectDataSource to it.

Finally I have had to instantiate my objects in the web form code behind,
use the ASP.NET 1.1 way of binding (assing to DataSource, and call
DataBind()) to be able to keep data objects in Session.
But when I do this by code I can't use VS wizards to configure databound
controls (like a gridview). And I have to create the templates, bindings and
so on manually.
In ASP.NET 1.1 I added the DataSets to my form as controls, so that I had
visual support for them. I can't believe it's no longer possible to do this.

If you could offer any further help I'd be very grateful. Even if you simply
confirm me that this is the way to do it now.

Jorge.

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8************************@msnews.microsoft.c om...
I now I can drop an ObjectDataSource to link directly to it, but, if I
do so, I can't modify the Dataset and keep it in Session to reuse it
later. What I'm trying to do is make several changes to the dataset
(in several postbacks), and when I decide everything it's right,
update the changes in the server. The ObjectDataSource forces me to
post the changes to the DB right when I make a single change in the
gridview


Change the code in the data access class to store the DataTable/DataSet in
Session (or in the cache).

-Brock
http://staff.develop.com/ballen

Jun 10 '06 #3
> Thank you very much for your help, but this doesn't solve my problem.
I think I'm missing something, but I can't find the way to access the
Page's Session object from my DAL or BLL clasess. How can I do it?


HttpContext.Current.Session

-Brock
http://staff.develop.com/ballen
Jun 10 '06 #4
Thank you very much. You can't imagine how helpful you've been!

Jorge.

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:b8************************@msnews.microsoft.c om...
Thank you very much for your help, but this doesn't solve my problem.
I think I'm missing something, but I can't find the way to access the
Page's Session object from my DAL or BLL clasess. How can I do it?


HttpContext.Current.Session

-Brock
http://staff.develop.com/ballen

Jun 10 '06 #5

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

Similar topics

0
by: William Ryan | last post by:
At the risk of sounding like a Big 5 consultant, "It depends". 1) Strongly typed datasets rock, they are faster than untyped, use intellisense... but your reason for wanting to use them is...
4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
16
by: Luqman | last post by:
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ? Best Regards, Luqman
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
25
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as...
2
by: S.Tedeschi | last post by:
Hi all gurus. I'm trying to switch to VS 2005, from VS 2003. I've an ASP.NET 1.1 app heavily relying on StronglyTyped DataSets, with lots of FindByKey..., dataSet.Tablename, and similar methods....
0
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
9
by: gardnern | last post by:
We have X number of data sets, of Y length each. For example... Small, Medium, Large and Red, Green, Blue, Yellow We need to generate a list of all possibilities Small Red
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.