473,490 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

where should I save temporary values

Hello!
I have made an application where user can get reading after entering his
name and the name of his partner. I tried to save the names in the database,
in the separate table. My solution:
AccessDataSource1.InsertCommand = "INSERT INTO var(var1) VALUES ('" &
Trim(TextBox1.Text) & "')" 'his name
AccessDataSource1.UpdateCommand = "UPDATE [var] SET [var2] = '" &
Trim(TextBox1.Text) & "' WHERE [id] = (select max(id)from var)" 'her name
and then on the second page:
AccessDataSource1.SelectCommand = "select var1,var2 from var WHERE [id] =
(select max(id)from var)" 'both names
This works fine, when not more users try to work with it at the same time.
Is there better solution for such temporary values? Would it be better to
save this values locally? How to do it?
Thank you
Mario
Oct 21 '06 #1
4 2999
Is this application specific data? If so, put it in the application cache:

cache.insert("partnerName", data)

and retreive it with cache("partnerName")

if it is user specfic data, put it into session state or viewstate:

viewstate.add("partnerName", data)

and retreive with viewstate("partnerName")


"Mario Krsnic" <pd********@sofortsurf.dewrote in message
news:eh**********@online.de...
Hello!
I have made an application where user can get reading after entering his
name and the name of his partner. I tried to save the names in the
database, in the separate table. My solution:
AccessDataSource1.InsertCommand = "INSERT INTO var(var1) VALUES ('" &
Trim(TextBox1.Text) & "')" 'his name
AccessDataSource1.UpdateCommand = "UPDATE [var] SET [var2] = '" &
Trim(TextBox1.Text) & "' WHERE [id] = (select max(id)from var)" 'her name
and then on the second page:
AccessDataSource1.SelectCommand = "select var1,var2 from var WHERE [id] =
(select max(id)from var)" 'both names
This works fine, when not more users try to work with it at the same time.
Is there better solution for such temporary values? Would it be better to
save this values locally? How to do it?
Thank you
Mario

Oct 21 '06 #2
Viewstate won't help the second page to retrieve the data from the first
one. Use session variables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Scott M." <s-***@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Is this application specific data? If so, put it in the application
cache:

cache.insert("partnerName", data)

and retreive it with cache("partnerName")

if it is user specfic data, put it into session state or viewstate:

viewstate.add("partnerName", data)

and retreive with viewstate("partnerName")


"Mario Krsnic" <pd********@sofortsurf.dewrote in message
news:eh**********@online.de...
>Hello!
I have made an application where user can get reading after entering his
name and the name of his partner. I tried to save the names in the
database, in the separate table. My solution:
AccessDataSource1.InsertCommand = "INSERT INTO var(var1) VALUES ('" &
Trim(TextBox1.Text) & "')" 'his name
AccessDataSource1.UpdateCommand = "UPDATE [var] SET [var2] = '" &
Trim(TextBox1.Text) & "' WHERE [id] = (select max(id)from var)" 'her
name
and then on the second page:
AccessDataSource1.SelectCommand = "select var1,var2 from var WHERE [id] =
(select max(id)from var)" 'both names
This works fine, when not more users try to work with it at the same
time.
Is there better solution for such temporary values? Would it be better to
save this values locally? How to do it?
Thank you
Mario


Oct 22 '06 #3
Thank you!

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgschrie b im
Newsbeitrag news:eb**************@TK2MSFTNGP02.phx.gbl...
Viewstate won't help the second page to retrieve the data from the first
one. Use session variables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Scott M." <s-***@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>Is this application specific data? If so, put it in the application
cache:

cache.insert("partnerName", data)

and retreive it with cache("partnerName")

if it is user specfic data, put it into session state or viewstate:

viewstate.add("partnerName", data)

and retreive with viewstate("partnerName")


"Mario Krsnic" <pd********@sofortsurf.dewrote in message
news:eh**********@online.de...
>>Hello!
I have made an application where user can get reading after entering
his name and the name of his partner. I tried to save the names in the
database, in the separate table. My solution:
AccessDataSource1.InsertCommand = "INSERT INTO var(var1) VALUES ('" &
Trim(TextBox1.Text) & "')" 'his name
AccessDataSource1.UpdateCommand = "UPDATE [var] SET [var2] = '" &
Trim(TextBox1.Text) & "' WHERE [id] = (select max(id)from var)" 'her
name
and then on the second page:
AccessDataSource1.SelectCommand = "select var1,var2 from var WHERE [id]
= (select max(id)from var)" 'both names
This works fine, when not more users try to work with it at the same
time.
Is there better solution for such temporary values? Would it be better
to save this values locally? How to do it?
Thank you
Mario



Oct 22 '06 #4
But, if this is not a multi-page scenario, ViewState is better because it
takes less server resources. Which is why I offered both as potential
candidates.
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:eb**************@TK2MSFTNGP02.phx.gbl...
Viewstate won't help the second page to retrieve the data from the first
one. Use session variables.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Scott M." <s-***@nospam.nospamwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>Is this application specific data? If so, put it in the application
cache:

cache.insert("partnerName", data)

and retreive it with cache("partnerName")

if it is user specfic data, put it into session state or viewstate:

viewstate.add("partnerName", data)

and retreive with viewstate("partnerName")


"Mario Krsnic" <pd********@sofortsurf.dewrote in message
news:eh**********@online.de...
>>Hello!
I have made an application where user can get reading after entering
his name and the name of his partner. I tried to save the names in the
database, in the separate table. My solution:
AccessDataSource1.InsertCommand = "INSERT INTO var(var1) VALUES ('" &
Trim(TextBox1.Text) & "')" 'his name
AccessDataSource1.UpdateCommand = "UPDATE [var] SET [var2] = '" &
Trim(TextBox1.Text) & "' WHERE [id] = (select max(id)from var)" 'her
name
and then on the second page:
AccessDataSource1.SelectCommand = "select var1,var2 from var WHERE [id]
= (select max(id)from var)" 'both names
This works fine, when not more users try to work with it at the same
time.
Is there better solution for such temporary values? Would it be better
to save this values locally? How to do it?
Thank you
Mario



Oct 22 '06 #5

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

Similar topics

2
1968
by: Newbee Adam | last post by:
how to save textbox values to 2 tables using sqladapter I am new with this. Do I need to ADO.net? what is the simplist correct way? or can I write a query in my vb.net form insert table...
1
1220
by: poi | last post by:
I want to detect through code where the ASP.NET temporary files location is, or where the System TEMP directory is, so I can write temporary datasets to that location. Normally the user is ASPNET,...
0
1262
by: Robert Love | last post by:
I am trying to save some boolean values from checkboxes using isolated storage. I am able to do strings and integers without a problem but I can't work out how to save boolean values without seeing...
6
1838
by: Sanjay | last post by:
Hi, Is it possible to save all the names/values of a form to another memo textfield before a Insert to the database then when required on another page split that memo textfield into the name and...
1
4403
by: adnanahmed714 | last post by:
hi how could i Save recordset values to txt file using vb thanks in advance
2
1668
by: xzzy | last post by:
1. What asp.net page event would I use to save the values of the controls just before a page closes? -- remainder of scenario -- 2. close the page and open a different page 3. open a new...
3
5778
by: anandmms | last post by:
Hello friends, I am having a table Personal_Detail, and in that table i am having some fields like name, id, phone_number etc... and also with two blob fields photo1, photo2(allow null). my...
9
3695
by: samgee | last post by:
Hi. I'm developing a code where it will store temporary data into gridview from textbox,and the value will have a link to google search. Now i want to save the values to database,according to...
0
969
by: Aaron Lawrence | last post by:
I send emails many times a day. All of the formatting is identical every time, there are just some values that change. Currently I have VB code that, when launched, opens a form where I enter the...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7183
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
7356
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
5448
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,...
1
4878
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...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.