Re: Passing variables through form

Tech-Archive recommends: Fix windows errors by optimizing your registry



But do you know of any way to pass a variable from a form to the SQL
insert
statement without creating a textbox?

The question is not one of passing a variable from a form to a SQL insert
statement. The question is one of passing data from a dynamic web page (or
client browser, or perhaps some other source) to another (or the same)
dynamic web page, which will use the data to perform a SQL query, and do
something (unkown) with the results. And yes, I know many ways of doing
this. Which method one uses depends on the requirements and the resultant
design of the application. However, you have not stated anything about the
requirements of your application, nor what the particular requirement of the
page you're discussing is. Instead, you have posted some pieces of an older
solution written for a different technology, without explaining the problem
that the solution was intended to solve.

This is a fairly common problem among beginners. As an analogy, let's talk
about programming as a way to get from Point A to Point B. In this analogy,
Point A is your home. Your home is in Birmingham, Alabama. Point B is the
New York City. Classic ASP is an automobile. Now, when you used your
automobile, you drove 8 hours to Bristol Tennessee, stayed at a hotel, and
then drove the rest of the way to New York City. ASP.Net is an airplane.
What you're asking me is "Where is the closest airport to Bristol Tennessee,
so I can land my plane there?" But what you're forgetting is that Bristol
Tennessee is not part of the problem. The problem is getting from
Birmingham, Alabama to New York City. So, now that you have a plane, you
need to ask yourself not where an airport is in Bristol Tennessee, but what
is the quickest way to get to New York in a plane from Birmingham, Alabama.
It turns out that, in a plane, you can fly straight through.

So, rather than telling me what your requirements are, you're asking me
where to land a plane in Bristol Tennessee. What I've been trying to tell
you is that, since you're now flying a plane, you need to re-think your
methodology, starting from your business requirements, and the available
resources (ASP.Net in this case), and determine how those resources can best
solve the problem.

If you can tell me what the requirements are, I can provide further
information. In other words, what is Point A, and what is Point B?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A brute awe as you,
a Metallic hag entity, eat us.


"Jason Mohan" <JasonMohan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F9FC5018-2ACC-43EC-A194-B7AEC1350DF5@xxxxxxxxxxxxxxxx
Thanks Kevin,
But do you know of any way to pass a variable from a form to the SQL
insert
statement without creating a textbox?

"Kevin Spencer" wrote:

Hi Jason,

I hate to tell you this, but classic ASP is to ASP.Net as the horse is to
the automobile. In other words, you have a whole different platform,
programming model and engine. So, whatever code you used with classic ASP
is
going to go out the window (if you know what's good for you). Classic ASP
is
scripted, procedural, and simple. ASP.Net is fully-compiled,
object-oriented, event-driven, and complex. While it is possible to do
things in a similar way, you would be wasting your time to do so. You
would
be better off sticking with classic ASP if you want to do that.

Otherwise, instead, you need to re-design your whole application engine,
from the database layer to the business layer, to the interface layer.
One
of the greatest strengths of OOP is that if you spend some time up front
thinking about design, extensibility, reusability, and structure, you
will
save many times that amount of time over the long run.

So, to make a long story short, the answer to the question "how can I
accomplish something like this in .NET" is "you can't." What you need to
do
is (1) familiarize yourself with OOP, .Net, and the ASP.Net programming
model, (2) re-examine the requirements of your original application, (3)
come up with a design for your application using the ASP.Net programming
model, (4) establish the various data layer, business layer and interface
layer classes you will need to build, (5) build those classes to be as
extensible as possible for future re-use, and (6) assemble these classes
into an ASP.Net web application.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A brute awe as you,
a Metallic hag entity, eat us.


"Jason Mohan" <JasonMohan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:83B138D4-9246-42FD-AAFE-8B928A649D90@xxxxxxxxxxxxxxxx
I need some help. I've been trying to get my form to work properly using
.NET
2.0 with Visual Studio 2005. Here's my problem. I used to program in
classic
asp, and recently started moving into the .NET framework. I used to
send
my
db id number through the form post method in ASP and it worked. Here's
how
I
did it.

default.asp?db_id=12 page
=============
<form method="post" action="post.asp?db_id=<%=
Request.QueryString("db_id")
%>&pid=1" name="postrun1">
all html and form content here
</form>

Then I would get the db_id number and pid using the Request.QueryString
method like so.

post.asp?db_id=12&pid=1 page
==============
db_id = Request.QueryString("db_id")
pid = Request.QueryString("pid")

I can't do this with .NET? how can I accomplish something like this in
.NET
it can't be visible to the user or on the page. Please help, my brain
is
about to fry trying to put this together. Usually the db_id or variable
will
be set on that page, or will come from the querystring from another
page.





.



Relevant Pages

  • Re: PCB Power Trace Widths, Ground Planes, and Routing
    ... I suppose I could go to a four layer board. ... even if the clock rate isn't. ... Can I connect these to one ground plane? ... Connect the 5V and 2.5V supplies to the islands using wide ...
    (sci.electronics.design)
  • Re: Passing variables through form
    ... "Kevin Spencer" wrote: ... I hate to tell you this, but classic ASP is to ASP.Net as the horse is to ... from the database layer to the business layer, ... is familiarize yourself with OOP, .Net, and the ASP.Net programming ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Power Planes and Bypass Capacitors
    ... Three of the layers will be for power planes which will have +5V, gnd, and -5V. ... Or share the +-5 on one plane and go down to 4. ... The component surface layer and the layer just under it are for routing. ... Because it can drive only 25pF at +/-5V power a stability network will be used to counter the 2nd pole in the feedback loop the op amp's output resistance makes with the capacitance of the driven line. ...
    (sci.electronics.design)
  • Re: 4-layer - which layer for ground, power?
    ... on the outer layers to contain EMI, presumably with ground on the SMT ... a hybrid with ground layer on top, power on layer 2, and signals on layer 3 and bottom? ... OTOH, 'b' and 'c' would support small "escape" traces on the top layer without cutting up the ground plane too badly, letting the board shrink a bit. ...
    (sci.electronics.design)
  • Re: Shielding (reducing capacitive coupling) between a high dv/dt node and a ground plane.
    ... LV ground plane ... HV ground plane (tied to LV ground at one point but parasitic cap ... There is a small node on the bottom layer that it picking up a noise spike ... The capacitance I ...
    (sci.electronics.design)