|
 |
aspx thread: RE: Storing temp data
Message #1 by "Sampath, Ramanujam (Cognizant)" <SRamanuj@c...> on Mon, 2 Sep 2002 11:20:30 +0530
|
|
Well Simon...
Request.QueryString("VehicleID");
This is ur code.. well check in the previous page whether u have sent the
value with the querystring...(NOTE: It is case sensitive... and use the same
case used wile sending the query string from ur previous page)...
keep me posted if u have issues....
==============================
S.Ramanujam
Programmer Analyst
Cognizant technology Solutions (p) Ltd. - CTS
38 & 39 Whites Road,
WCB - Whites Road Circular Building
Royapettah, Chennai - 600014
Ph : +xx xx xxx xxxx Extn 5113 [Off]
: +xx xx xxx xxxx [Res]
-----Original Message-----
From: Simon Robinson [mailto:srobinson@g...]
Sent: Saturday, August 31, 2002 3:40 AM
To: ASP+
Subject: [aspx] RE: Storing temp data
Hi Sampath,
Yeah I'm starting to have problems...
I am am getting the following error:-
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0118: 'System.Web.HttpRequest.QueryString'
denotes a 'property' where a 'method' was expected
Source Error:
Line 17: string VehicleID;
Line 18:
Line 19: VehicleID = Request.QueryString("VehicleID");
Line 20:
Line 21: table= new DataTable("Lightbox");
-------------------------------------------------------
Here is the code:-
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Retrieving Data from a Database</title>
<script language="C#" runat="server">
void Page_Load()
{
DataTable table;
DataColumn col;
DataRow row;
int i;
string VehicleID;
VehicleID = Request.QueryString("VehicleID");
table= new DataTable("Lightbox");
table.MinimumCapacity=1;
table.CaseSensitive=false;
col.AutoIncrement=true;
col.AllowDBNull=false;
col
table.Columns.Add("VehicleID",System.Type.GetType("System.String"));
col.AllowDBNull=false;
row = table.NewRow();
row["VehicleID"]= Vehicle;
table.Rows.Add(row);
DataSet ds = new DataSet(table);
dataGridControl.DataSource = table;
dataGridControl.DataSource = ds.Tables[0].DefaultView;
dataGridControl.DataSource = ds.Tables["VehicleID"];
dataGridControl.DataBind();
Response.Write(ds.Tables["VehicleID"].Rows.Count);
//Response.Write(" ");
Response.Write(ds.Tables["VehicleID"].Columns.Count);
}
</script>
</head>
<body>
<asp:DataGrid id="dataGridControl" runat="server" />
</body>
</html>
Thanx simon....
keep me posted if u still have any more issues....
I'll be happy to solve them..... cause ".Net makes IT Happen"
============================== S.Ramanujam Programmer Analyst Cognizant
technology Solutions (p) Ltd. - CTS 38 & 39 Whites Road, WCB - Whites
Road Circular Building Royapettah, Chennai - 600014 Ph : +xx xx xxx xxxx
Extn 5113 [Off]
: +xx xx xxx xxxx [Res]
-----Original Message-----
From: Simon Robinson [mailto:srobinson@g...]
Sent: Friday, August 30, 2002 10:32 PM
To: ASP+
Subject: [aspx] RE: Storing temp data
Mike, Sampath,
I have got to say that there are some really great people on this forum
and you are definitely two of them!
I am eternally grateful for all of your help!
Keep the faith.
Simon.
-----Original Message-----
From: Mike Amundsen [mailto:mike@a...]
Sent: 29 August 2002 17:30
To: ASP+
Subject: [aspx] RE: Storing temp data
You might want to check the source code and database for the IBuySpy
store app. That app allowed folks to add items to a shopping cart
*before* they logged in as a user to close their order.
http://www.ibuyspy.com
MCA
Mike Amundsen
mca@E...
host your .NET Apps @ EraServer.NET
-----Original Message-----
From: John Pirkey [mailto:mailjohnny101@y...]
Sent: Thursday, August 29, 2002 2:15 PM
To: ASP+
Subject: [aspx] RE: Storing temp data
i once saw an application that created tables using the SessionID as the
table name
- that should be unique - and easy to determine which table to select
from.
of course, if this is a multiple IIS server environment, this will not
work, as the session ID's are not 100% guaranteed unique (although not
likely to encounter the same one).
just a thought.
john
--- Wim Verdeyen <Wim.Verdeyen@e...> wrote:
> Maybe you can store the carid's in a cookie ?
>
> -----Original Message-----
> From: Simon Robinson [mailto:srobinson@g...]
> Sent: donderdag 29 augustus 2002 18:20
> To: ASP+
> Subject: [aspx] Storing temp data
>
>
> Hi All,
>
> I have created a site where the user selects a car by model, category
> and style. The DB is queried and a list of the models is displayed.
>
> At this stage I want the user to be able to add the cars to a shopping
> basket by clicking on 'add to basket' This will be a temporary store
of
> the cars before they move on to order completion.
>
> Does anybody know what the best way to do this is? Each shopping
basket
> must have a unique ID. I have considered temporary tables in SQL
Server
> however I do not know how to create a unique name for each shopping
> basket table.
>
> Does anybody have any ideas on this or otherwise.
>
> Many thanks,
>
> Simon.
> ---
>
> ASP.NET 1.0 Namespace Reference with C#
> http://www.wrox.com/acon11.asp?ISBN=1861007442
>
> ASP.NET 1.0 Namespace Reference with VB.NET
> http://www.wrox.com/acon11.asp?ISBN=1861007450
>
> These books are a complete reference to the ASP.NET namespaces
> for developers who are already familiar with using ASP.NET.
> There is no trivial introductory material or useless .NET
> hype and the presentation of the namespaces, in an easy-to use
> alphabetical order ensures a user-friendly reference format.
> We provide in-depth coverage of all the major ASP.NET classes,
> giving you those real-world tips that the documentation doesn't
> offer, and demonstrating complex techniques with simple
> examples.
>
> ---
>
>
> ---
>
> ASP.NET 1.0 Namespace Reference with C#
> http://www.wrox.com/acon11.asp?ISBN=1861007442
>
> ASP.NET 1.0 Namespace Reference with VB.NET
> http://www.wrox.com/acon11.asp?ISBN=1861007450
>
> These books are a complete reference to the ASP.NET namespaces
> for developers who are already familiar with using ASP.NET.
> There is no trivial introductory material or useless .NET
> hype and the presentation of the namespaces, in an easy-to use
> alphabetical order ensures a user-friendly reference format.
> We provide in-depth coverage of all the major ASP.NET classes,
> giving you those real-world tips that the documentation doesn't
> offer, and demonstrating complex techniques with simple
> examples.
>
> ---
=====
----------------------------
John Pirkey
MCSD
http://www.stlvbug.org
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
Message #2 by "Shreekar" <joshishreekar@r...> on 3 Sep 2002 13:45:37 -0000
|
|
Hi Simon,
Well, there are two angles to this problem:
(1) No need to create multiple tables to store data
(2) Deviding a Primary Key
As to (1):
U can create header and detail tables if needed or just the header
as required.
As to (2)
option 1 Use identity in SQL Server/ Autonumber in Access
option 2 Use Session id
If u go with option 1, u will need to devise some way to pass
around the key across pages
If u go with option 2, u already have got that unique key is form
of session id on all pages.
The idea is something like this:
When user presses add to cart, check the header table for an entry
of the session id/ autonumber. If found, simply add this record to
the detail table.
If not found, then insert this record in the header as well as the
detail table.
This way, u can also easily handle edit/delete with shopping
cart.
Get back in case of any further queries
Regards
Shreekar Joshi
-----Original Message-----
From: Mike Amundsen [mailto:mike@a...]
Sent: 29 August 2002 17:30
To: ASP+
Subject: [aspx] RE: Storing temp data
You might want to check the source code and database for the
IBuySpy
store app. That app allowed folks to add items to a shopping
cart
*before* they logged in as a user to close their order.
http://www.ibuyspy.com
MCA
Mike Amundsen
mca@E...
host your .NET Apps @ EraServer.NET
-----Original Message-----
From: John Pirkey [mailto:mailjohnny101@y...]
Sent: Thursday, August 29, 2002 2:15 PM
To: ASP+
Subject: [aspx] RE: Storing temp data
i once saw an application that created tables using the SessionID
as the
table name
- that should be unique - and easy to determine which table to
select
from.
of course, if this is a multiple IIS server environment, this will
not
work, as the session ID's are not 100% guaranteed unique (although
not
likely to encounter the same one).
just a thought.
john
--- Wim Verdeyen <Wim.Verdeyen@e...> wrote:
>Maybe you can store the carid's in a cookie ?
>
>-----Original Message-----
> From: Simon Robinson [mailto:srobinson@g...]
>Sent: donderdag 29 augustus 2002 18:20
>To: ASP+
>Subject: [aspx] Storing temp data
>
>
>Hi All,
>
>I have created a site where the user selects a car by model,
>category
>and style. The DB is queried and a list of the models is
>displayed.
>
>At this stage I want the user to be able to add the cars to a
>shopping
>basket by clicking on 'add to basket' This will be a temporary
>store
of
>the cars before they move on to order completion.
>
>Does anybody know what the best way to do this is? Each
>shopping
basket
>must have a unique ID. I have considered temporary tables in
>SQL
Server
>however I do not know how to create a unique name for each
>shopping
>basket table.
>
>Does anybody have any ideas on this or otherwise.
>
>Many thanks,
>
>Simon.
>---
__________________________________________________________
Give your Company an email address like
ravi @ ravi-exports.com. Sign up for Rediffmail Pro today!
Know more. http://www.rediffmailpro.com/signup/
|
|
 |