Need ID going into Database

Discussion in 'ASP .Net' started by JJ297, Sep 25, 2007.

  1. JJ297

    JJ297 Guest

    Could someone assist me. I have the selected value from a tree view
    going to another page with this code:

    Response.Redirect("RequestForm.aspx?TitleID=" &
    TreeView1.SelectedValue)

    On the RequestForm.aspx page load section I have this:

    TitleTxt.Text = Request.QueryString("TitleID")


    I have this for my button click:
    ..CommandText = "AddLoanRequest" '

    ..Parameters.AddWithValue("@RequestorEmail", EmailAdd.Text)

    ..Parameters.AddWithValue("@TitleID", TitleTxt.Text)

    How do I get just the title ID to go into the database. Right now
    it's going in as the title ("name") but I only want the Title ID

    Here's AddLoanRequest Stored Procedure

    @RequestorEmail varchar (75),
    @TitleID varchar(255),

    AS


    INSERT INTO Requestors(RequestorEmail,TitleID)

    values

    (@RequestorEmail,
    @TitleID)


    Thanks for your help
     
    JJ297, Sep 25, 2007
    #1
    1. Advertising

  2. On Sep 25, 5:29 pm, JJ297 <> wrote:
    > Could someone assist me. I have the selected value from a tree view
    > going to another page with this code:
    >
    > Response.Redirect("RequestForm.aspx?TitleID=" &
    > TreeView1.SelectedValue)
    >
    > On the RequestForm.aspx page load section I have this:
    >
    > TitleTxt.Text = Request.QueryString("TitleID")
    >
    > I have this for my button click:
    > .CommandText = "AddLoanRequest" '
    >
    > .Parameters.AddWithValue("@RequestorEmail", EmailAdd.Text)
    >
    > .Parameters.AddWithValue("@TitleID", TitleTxt.Text)
    >
    > How do I get just the title ID to go into the database. Right now
    > it's going in as the title ("name") but I only want the Title ID
    >
    > Here's AddLoanRequest Stored Procedure
    >
    > @RequestorEmail varchar (75),
    > @TitleID varchar(255),
    >
    > AS
    >
    > INSERT INTO Requestors(RequestorEmail,TitleID)
    >
    > values
    >
    > (@RequestorEmail,
    > @TitleID)
    >
    > Thanks for your help


    If understand you correct, you would need to tell to the TreeView the
    id for each node in the tree.

    I think you have right now something like this

    TreeNode newNode = new TreeNode(Name);
    TreeView1.Nodes.Add(newNode);

    Add an ID as a second parameter

    TreeNode newNode = new TreeNode(Name, Id);
     
    Alexey Smirnov, Sep 25, 2007
    #2
    1. Advertising

  3. JJ297

    JJ297 Guest

    On Sep 25, 1:35 pm, Alexey Smirnov <> wrote:
    > On Sep 25, 5:29 pm, JJ297 <> wrote:
    >
    >
    >
    >
    >
    > > Could someone assist me. I have the selected value from a tree view
    > > going to another page with this code:

    >
    > > Response.Redirect("RequestForm.aspx?TitleID=" &
    > > TreeView1.SelectedValue)

    >
    > > On the RequestForm.aspx page load section I have this:

    >
    > > TitleTxt.Text = Request.QueryString("TitleID")

    >
    > > I have this for my button click:
    > > .CommandText = "AddLoanRequest" '

    >
    > > .Parameters.AddWithValue("@RequestorEmail", EmailAdd.Text)

    >
    > > .Parameters.AddWithValue("@TitleID", TitleTxt.Text)

    >
    > > How do I get just the title ID to go into the database. Right now
    > > it's going in as the title ("name") but I only want the Title ID

    >
    > > Here's AddLoanRequest Stored Procedure

    >
    > > @RequestorEmail varchar (75),
    > > @TitleID varchar(255),

    >
    > > AS

    >
    > > INSERT INTO Requestors(RequestorEmail,TitleID)

    >
    > > values

    >
    > > (@RequestorEmail,
    > > @TitleID)

    >
    > > Thanks for your help

    >
    > If understand you correct, you would need to tell to the TreeView the
    > id for each node in the tree.
    >
    > I think you have right now something like this
    >
    > TreeNode newNode = new TreeNode(Name);
    > TreeView1.Nodes.Add(newNode);
    >
    > Add an ID as a second parameter
    >
    > TreeNode newNode = new TreeNode(Name, Id);- Hide quoted text -
    >
    > - Show quoted text -


    Actually I got it I needed to add the value of the tree node to the
    tree node. Thanks for your help!
     
    JJ297, Sep 25, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Johnson Jr.
    Replies:
    2
    Views:
    447
    Eric Veltman
    Dec 11, 2003
  2. John Holmes
    Replies:
    2
    Views:
    374
    =?Utf-8?B?UGxpc3Nza2lu?=
    Jul 9, 2004
  3. Alan Silver
    Replies:
    5
    Views:
    437
    Alan Silver
    Jul 26, 2007
  4. p.
    Replies:
    10
    Views:
    647
    Albert van der Horst
    Jan 28, 2008
  5. Renie83
    Replies:
    2
    Views:
    237
Loading...

Share This Page