Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple DataKeyNames to pass selectedvalue from Grid -> Detailsview?

Status
Not open for further replies.

Dijital

MIS
Mar 15, 2002
47
0
0
US
I have been playing with this for a few hours now and I just cannot understand what I am doing wrong.

I have a table of assets, tied to Users via fname, lname.

ID - fname - lname - sn - type
1 - John - Smith - 1234 - laptop
2 - Jim - Mack - 9876 - laptop
3 - Jane - Does - 4567 - laptop
4 - John - Doesnt - 1289 - laptop
5 - Scooby - Doo - 8472 - laptop

Gridview1 = select distinct(fname,lname) from table
Detailsview1 = select * from table where (([fname] = @fname) AND ([lname] = @lname))

If I do this in my sandbox with two tables (Users and Assets) things work fine.
If I do this just tying it via the fname - it works! However with two Johns about - you see the issue that could create.
The Detailsview1 just never renders when the item is selected and the two values are passed. Anyone have any idea what I am doing wrong here? Or am I making an assumption that I should not be?

Thanks!

Jim
 
Well, we don't have all of your code and markup, so I will make a few assumptions.

Are you using the DataSource controls? If so, don't. They are not debugable and are only good for very simple seneiros, I suggest you don't use them and write the DB aceess code yourself.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top