Off Roading Forums banner
1 - 5 of 5 Posts

· Registered
Joined
·
850 Posts
Discussion Starter · #1 ·
Hey I'm reaching out to the geeks in here for help. I'm working on an ASP.net application and have run into a huge wall. Here's my situation...

I have a datagrid with several records of information. I am trying to create a column labeled "edit" which when clicked, it will populate a webform which exists on the same page as the datagrid. I am having problems binding the data to a variable so that the record can be populated into the database. I am assuming that once I find out the "record ID" from the database, I can use an SQL SELECT statement to pull the data from the database. But I am unsure if this is correct or not. What would I write to assign the index value to a variable so that I can do a select statement? I have a feeling it would be placed in the EditRecord Subroutine but am not sure...

See attached file for code..

Thanks for any help you guys may have!!!

 

Attachments

· Registered
Joined
·
1,240 Posts
In reply to:

But I am unsure if this is correct or not.

[/ QUOTE ]

Wow, I understood this sentence.


Sorry, way over my head.
I had some pearl a few years back, but I guess those cells have died too.
Good Luck with your problem.
Jim
 

· Registered
Joined
·
850 Posts
Discussion Starter · #4 ·
I've been Googling for the past 3 days... I'm going nuts because it seems like it should an extremely simple piece of code which will provide the connection and I feel like a complete idiot for not being able to figure it out!!

Any help you can drum up would be FABULOUS...

FYI - I am looking for something similar to this:

Update Database

Except instead of a datalist, I have a Datagrid.

Thanks!!!
Sean

me in the head!
 
G

·
Not sure if this is what you are looking for, but I passed it on to one of my friends and this is what he got back to me with.

I also attached the URL in your last post so that is what he is refering to.

If not, let me know and I can ask again.

In reply to:

Well it sounds like he wants to use your link combined with this http://www.aspnet101.com/aspnet101/...spx?code=dgEdit

If he wants it exactly like that first link then this in the line of code he needs to look at specifically:
Dim sql as string = "Select ID, Fname, Lname from TestInsert Where ID = " & list1.selecteditem.value

If he is using a grid then he needs to use something like this instead:
Dim sql as string = "Select ID, Fname, Lname from TestInsert Where ID = " & @RecordID

If sounds like he trying to query the database with the index id of the grid instead of the value of the key field in the row.

[/ QUOTE ]
 
1 - 5 of 5 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top