|
-
Jun 19th, 2010, 10:22 PM
#1
Thread Starter
Lively Member
how would I do this?
I have a page called editTrip. Each "trip" has a few tables of information stored in a SQL Server DB, with several queries fething that data, and one function that funnels it to a single dataset (in the business logic layer), and returns the DS to the page when requesting that specific trip.
Ok i want to be able to edit that trips information without making several requests to the database. And then do the final "save" at the end. So, I think I need a "strong-typed" dataset in the code behind of editTrip to act as a temporary dataset?
Say for instance, you edit information in a table of a trip, then you edit more information in a different table (same trip still). I only want it to update the actual SQL database when the user clicks "save all" on the bottom. So i need a temporary dataset? Where would I put it? I just need to know how to make that temporary dataset...Any ideas?
-
Jun 20th, 2010, 05:19 AM
#2
Re: how would I do this?
jtm235,
I am having trouble following what you are asking?!?
Can you provide examples of the type of information that you are pulling back, and from what database tables, etc.
It sounds like what you are after is a transaction, where you want to update all associated tables, and if one fails, you need to roll back the other changes, but without some more information, it is going to be difficult to say.
Gary
-
Jun 20th, 2010, 07:27 AM
#3
Thread Starter
Lively Member
Re: how would I do this?
Ok, Gary...On this page, there will be information for a single "trip"(The page is by no means functional). It calls data from multiple tables (legs, billing codes, and tripInvoices have multiple rows per trip)... whenever I edit the data (like add another billing code, leg, or invoice to a trip, I want that information to update the sql database when the user clicks a "save all" function on the bottom. So I need a temporary dataset to store the trips tables in mean time...
hope this helps
Last edited by jtm235; Jun 22nd, 2010 at 09:19 AM.
-
Jun 20th, 2010, 08:32 AM
#4
Frenzied Member
Re: how would I do this?
hey,
you can do this through transactions
and then you commit if there is any problem, just rollback
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 02:58 PM
#5
Thread Starter
Lively Member
Re: how would I do this?
ok maybe this can explain what im looking for little better.
1) I want to grab a dataset from the SQL database.
2) EDIT that dataset, WITHOUT bothering the SQL database whatsoever. This will involve a lot of client activity and postbacks
3) Then SUBMIT the modified dataset to SQL database.
Im pretty sure I can easily accomplish (1) and (3) in the business logic layer, so I just need to know how I can store the "temporary" dataset PER CLIENT or PER PAGE (step 2).
-
Jun 22nd, 2010, 03:10 PM
#6
Frenzied Member
Re: how would I do this?
actually you can store the dataset inside your Session
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 03:18 PM
#7
Thread Starter
Lively Member
Re: how would I do this?
I was made to believe that large variables in the Session slow down the server considerably. Although, the dataset wont be more than a few tables, with 1 or a couple rows, spanning 3-15 columns.
A question about session variables: What actually slows down the server, when clients request the session variable value, or just having them stored? Are they stored in RAM?
-
Jun 22nd, 2010, 03:22 PM
#8
Frenzied Member
Re: how would I do this?
actually you can clear your session value after you get your data.
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 03:26 PM
#9
Frenzied Member
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 03:28 PM
#10
Frenzied Member
Re: how would I do this?
and sorry i found another link for the vbf
http://www.vbforums.com/showthread.php?t=544023
also have a look
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 04:04 PM
#11
Thread Starter
Lively Member
Re: how would I do this?
 Originally Posted by avrail
actually you can clear your session value after you get your data.
like i said i want to do more than get the data, want to edit the dataset and submit it to the database for updates. But it looks like I will be using session variables nevertheless.
Do you think session variables are my only option for my implementation described above?
-
Jun 22nd, 2010, 04:22 PM
#12
Frenzied Member
Re: how would I do this?
 Originally Posted by jtm235
like i said i want to do more than get the data, want to edit the dataset and submit it to the database for updates. But it looks like I will be using session variables nevertheless.
Do you think session variables are my only option for my implementation described above?
actually,
you can crate a class , with a static variable,
Code:
public static System.Data.DataSet dataSet = null;
and you can access it using YourClassName.dataSet
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 04:33 PM
#13
Thread Starter
Lively Member
Re: how would I do this?
i like that idea...what if i created a dataset instead, with only datatables? How would I access that dataset in my business logic layer? (from previous experience with data access layer/business logic layer, I only know how to call functions from a dataset in the BLL which returns a DS. Dont know how to manipulate the data in a DS with code...)
-
Jun 22nd, 2010, 04:43 PM
#14
Frenzied Member
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 05:41 PM
#15
Thread Starter
Lively Member
Re: how would I do this?
cool thanks. but i think i can make the strong-typed dataset easily in visual studio, with the "add dataset" feature. I dont want any table adapters, i just wanna fill tables and view/edit data in that particular DS.
-
Jun 22nd, 2010, 05:48 PM
#16
Frenzied Member
Re: how would I do this?
sound great jtm,
i am looking forward to see this thread resolved
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 22nd, 2010, 05:53 PM
#17
Thread Starter
Lively Member
Re: how would I do this?
yeah thanks. i just gotta figure out how to do those functions now
-
Jun 22nd, 2010, 05:58 PM
#18
Frenzied Member
Re: how would I do this?
no thanks man, I know you will do it
good luck,
and don't forget to remark the thread as resolved when you finish
and if there is any update let us know
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 23rd, 2010, 01:02 AM
#19
Re: how would I do this?
 Originally Posted by avrail
actually,
you can crate a class , with a static variable,
Code:
public static System.Data.DataSet dataSet = null;
and you can access it using YourClassName.dataSet
A class marked as static would exist for all users of your site. You mentioned earlier that you wanted to allow changes to a DataSet on a per user basis, this would not work with a static class.
Gary
-
Jun 23rd, 2010, 01:38 AM
#20
Frenzied Member
Re: how would I do this?
 Originally Posted by gep13
A class marked as static would exist for all users of your site. You mentioned earlier that you wanted to allow changes to a DataSet on a per user basis, this would not work with a static class.
Gary
yes, gep
if i marked the class as static, the object value will be for all users,
and if you want the dataset per user sure this will not be the right thing to do
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 24th, 2010, 10:00 PM
#21
Thread Starter
Lively Member
Re: how would I do this?
what if I wanted a dataset "per page"...
-
Jun 25th, 2010, 12:56 AM
#22
Re: how would I do this?
Do you mean a DataSet per page, per user?
Gary
-
Jun 25th, 2010, 09:23 AM
#23
Thread Starter
Lively Member
Re: how would I do this?
yes, a dataset per page, per user...
I feel like a temporary session object is the only way to do this.
-
Jun 25th, 2010, 09:42 AM
#24
Frenzied Member
Re: how would I do this?
 Originally Posted by jtm235
yes, a dataset per page, per user...
I feel like a temporary session object is the only way to do this.
i think this is the way that you need
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 25th, 2010, 09:45 AM
#25
Frenzied Member
Re: how would I do this?
but Session will be per user over the whole application
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 25th, 2010, 09:53 AM
#26
Thread Starter
Lively Member
Re: how would I do this?
I know, but I can set the variable to 'Nothing' when I navigate off the page, so it doesn't take up memory during the entire session.
all I really need is a dataset that is stored between multiple postbacks of the same page. I could store it in the actual page, but that seems inefficient.
-
Jun 25th, 2010, 10:01 AM
#27
Frenzied Member
Re: how would I do this?
 Originally Posted by jtm235
I know, but I can set the variable to 'Nothing' when I navigate off the page, so it doesn't take up memory during the entire session.
all I really need is a dataset that is stored between multiple postbacks of the same page. I could store it in the actual page, but that seems inefficient.
you can use ViewState to store your dataset but really i didn't recommend it, because this will effect on your page load
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 25th, 2010, 10:08 AM
#28
Frenzied Member
Re: how would I do this?
you can use SQL Server to manage you session
http://support.microsoft.com/kb/317604
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 25th, 2010, 05:38 PM
#29
Thread Starter
Lively Member
Re: how would I do this?
Yeah I looked into viewstate, seems ineffecient. I AM going with session variables. Also, I am researching the different memory options for my session variables. for now, im sticking with In-proc. I still have to do some more research on the effeciency of SQL storage of session variables and determine what fits my application the best.
Thanks
-
Jun 25th, 2010, 05:41 PM
#30
Frenzied Member
Re: how would I do this?
i think the SQL well be fair enough,
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jun 26th, 2010, 04:25 AM
#31
Re: how would I do this?
 Originally Posted by jtm235
I could store it in the actual page, but that seems inefficient.
No, this wouldn't work, as this would be per user.
For what you are describing, I believe Session is the only place that you will be able to store it. You will just have to remember to tidy up after yourself once you are finished with the objects.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|