Need ID going into Database

J

JJ297

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
 
G

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

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);
 
J

JJ297

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top