Writing to Database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Always Learning

    Writing to Database

    Hi Guys,

    I am still searching for an answer to this question. Can you help me?

    If I have a field on a .aspx form, the classic Textbox1. How do I send the
    Textbox1.Text to an .Asp page and assign it to say rs("Name") variable.
    Because I have used Request.Redirec t("writetodb.as p") in my button click
    event, I thought I could use
    rs("Name") = request.form("T extbox1") but this does not work.

    I am using this method because I am trying to create a new .net input form
    based on an old .asp form and then calling the original .asp page to write
    to the database. If I could just convert the .net form variables to the
    variables I used in my original .Asp page all would be ok.

    Any ideas would be greatly appreciated.

    Best Regards,

    Steve Wilson.


  • Always Learning

    #2
    Gav

    Hi Gav,
    Thanks for the response.
    Is there no way to reference the request form variables like classic asp?

    Best regards,

    Steve Wilson.

    "Gav" <spam@spam.co m> wrote in message
    news:%233O7t28P DHA.3768@tk2msf tngp13.phx.gbl. ..[color=blue]
    > Once you have 'redirected' to another page Textbox1 will no longer exist[/color]
    you[color=blue]
    > have to put it in the url and put it in rs('') in the ASP page... ie
    > aspx
    > Request.Redirec t("writetodb.as p?Name=" + Textbox1.Text)
    > asp
    > rs("Name")= Request.Param(" Name");
    >
    >
    >
    > "Always Learning" <steve.wilson@l ineone.net> wrote in message
    > news:OKIwGR8PDH A.3144@tk2msftn gp13.phx.gbl...[color=green]
    > > Hi Guys,
    > >
    > > I am still searching for an answer to this question. Can you help me?
    > >
    > > If I have a field on a .aspx form, the classic Textbox1. How do I send[/color][/color]
    the[color=blue][color=green]
    > > Textbox1.Text to an .Asp page and assign it to say rs("Name") variable.
    > > Because I have used Request.Redirec t("writetodb.as p") in my button click
    > > event, I thought I could use
    > > rs("Name") = request.form("T extbox1") but this does not work.
    > >
    > > I am using this method because I am trying to create a new .net input[/color][/color]
    form[color=blue][color=green]
    > > based on an old .asp form and then calling the original .asp page to[/color][/color]
    write[color=blue][color=green]
    > > to the database. If I could just convert the .net form variables to the
    > > variables I used in my original .Asp page all would be ok.
    > >
    > > Any ideas would be greatly appreciated.
    > >
    > > Best Regards,
    > >
    > > Steve Wilson.
    > >
    > >[/color]
    >
    >[/color]


    Comment

    • Gav

      #3
      Re: Gav

      I'm not sure about that, sorry. I've not done it from aspx to asp but I have
      from aspx to aspx and the only ways I know to do it is, to either put it in
      the URL as said before... or to use session variables.

      Sorry I can't help you more.

      Gav

      "Always Learning" <steve.wilson@l ineone.net> wrote in message
      news:%23XKxxH9P DHA.304@tk2msft ngp13.phx.gbl.. .[color=blue]
      > Hi Gav,
      > Thanks for the response.
      > Is there no way to reference the request form variables like classic asp?
      >
      > Best regards,
      >
      > Steve Wilson.
      >
      > "Gav" <spam@spam.co m> wrote in message
      > news:%233O7t28P DHA.3768@tk2msf tngp13.phx.gbl. ..[color=green]
      > > Once you have 'redirected' to another page Textbox1 will no longer exist[/color]
      > you[color=green]
      > > have to put it in the url and put it in rs('') in the ASP page... ie
      > > aspx
      > > Request.Redirec t("writetodb.as p?Name=" + Textbox1.Text)
      > > asp
      > > rs("Name")= Request.Param(" Name");
      > >
      > >
      > >
      > > "Always Learning" <steve.wilson@l ineone.net> wrote in message
      > > news:OKIwGR8PDH A.3144@tk2msftn gp13.phx.gbl...[color=darkred]
      > > > Hi Guys,
      > > >
      > > > I am still searching for an answer to this question. Can you help me?
      > > >
      > > > If I have a field on a .aspx form, the classic Textbox1. How do I send[/color][/color]
      > the[color=green][color=darkred]
      > > > Textbox1.Text to an .Asp page and assign it to say rs("Name")[/color][/color][/color]
      variable.[color=blue][color=green][color=darkred]
      > > > Because I have used Request.Redirec t("writetodb.as p") in my button[/color][/color][/color]
      click[color=blue][color=green][color=darkred]
      > > > event, I thought I could use
      > > > rs("Name") = request.form("T extbox1") but this does not work.
      > > >
      > > > I am using this method because I am trying to create a new .net input[/color][/color]
      > form[color=green][color=darkred]
      > > > based on an old .asp form and then calling the original .asp page to[/color][/color]
      > write[color=green][color=darkred]
      > > > to the database. If I could just convert the .net form variables to[/color][/color][/color]
      the[color=blue][color=green][color=darkred]
      > > > variables I used in my original .Asp page all would be ok.
      > > >
      > > > Any ideas would be greatly appreciated.
      > > >
      > > > Best Regards,
      > > >
      > > > Steve Wilson.
      > > >
      > > >[/color]
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Gav

        #4
        Re: Gav

        Steve,

        you can not use the session variable in the asp page... what is wrong with
        putting it in the url of the page?

        The only way I can see you achieving what you want is by either sending the
        variables in the url like I mentioned before or better yet why don't you
        write a new web service to go with your new web application and get that to
        write the variables to the database. It is easy enough to do.

        Gavin

        "Always Learning" <steve.wilson@l ineone.net> wrote in message
        news:eQWDe%23%2 3PDHA.3088@TK2M SFTNGP10.phx.gb l...[color=blue]
        > Hi Gav,
        >
        > I have tried using
        > Session("Name") = Textbox1.Text
        > Session("Teleph one") = TextBox2.Text
        > in the .aspx page but how do I reference them in the .asp page. I am[/color]
        having[color=blue]
        > trouble with this.
        >
        > Thanks for your help.
        >
        > Steve Wilson.
        >
        > "Gav" <spam@spam.co m> wrote in message
        > news:eqIGwQ9PDH A.2852@tk2msftn gp13.phx.gbl...[color=green]
        > > I'm not sure about that, sorry. I've not done it from aspx to asp but I[/color]
        > have[color=green]
        > > from aspx to aspx and the only ways I know to do it is, to either put it[/color]
        > in[color=green]
        > > the URL as said before... or to use session variables.
        > >
        > > Sorry I can't help you more.
        > >
        > > Gav
        > >
        > > "Always Learning" <steve.wilson@l ineone.net> wrote in message
        > > news:%23XKxxH9P DHA.304@tk2msft ngp13.phx.gbl.. .[color=darkred]
        > > > Hi Gav,
        > > > Thanks for the response.
        > > > Is there no way to reference the request form variables like classic[/color][/color]
        > asp?[color=green][color=darkred]
        > > >
        > > > Best regards,
        > > >
        > > > Steve Wilson.
        > > >
        > > > "Gav" <spam@spam.co m> wrote in message
        > > > news:%233O7t28P DHA.3768@tk2msf tngp13.phx.gbl. ..
        > > > > Once you have 'redirected' to another page Textbox1 will no longer[/color][/color]
        > exist[color=green][color=darkred]
        > > > you
        > > > > have to put it in the url and put it in rs('') in the ASP page...[/color][/color][/color]
        ie[color=blue][color=green][color=darkred]
        > > > > aspx
        > > > > Request.Redirec t("writetodb.as p?Name=" + Textbox1.Text)
        > > > > asp
        > > > > rs("Name")= Request.Param(" Name");
        > > > >
        > > > >
        > > > >
        > > > > "Always Learning" <steve.wilson@l ineone.net> wrote in message
        > > > > news:OKIwGR8PDH A.3144@tk2msftn gp13.phx.gbl...
        > > > > > Hi Guys,
        > > > > >
        > > > > > I am still searching for an answer to this question. Can you help[/color][/color]
        > me?[color=green][color=darkred]
        > > > > >
        > > > > > If I have a field on a .aspx form, the classic Textbox1. How do I[/color][/color]
        > send[color=green][color=darkred]
        > > > the
        > > > > > Textbox1.Text to an .Asp page and assign it to say rs("Name")[/color]
        > > variable.[color=darkred]
        > > > > > Because I have used Request.Redirec t("writetodb.as p") in my button[/color]
        > > click[color=darkred]
        > > > > > event, I thought I could use
        > > > > > rs("Name") = request.form("T extbox1") but this does not work.
        > > > > >
        > > > > > I am using this method because I am trying to create a new .net[/color][/color]
        > input[color=green][color=darkred]
        > > > form
        > > > > > based on an old .asp form and then calling the original .asp page[/color][/color][/color]
        to[color=blue][color=green][color=darkred]
        > > > write
        > > > > > to the database. If I could just convert the .net form variables[/color][/color][/color]
        to[color=blue][color=green]
        > > the[color=darkred]
        > > > > > variables I used in my original .Asp page all would be ok.
        > > > > >
        > > > > > Any ideas would be greatly appreciated.
        > > > > >
        > > > > > Best Regards,
        > > > > >
        > > > > > Steve Wilson.
        > > > > >
        > > > > >
        > > > >
        > > > >
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...