Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
DataList and SqlDataSource SelectCommand Parameter
Vikram
14y
6.5k
1
Reply
Hi,
In my application, I am using DataList. In Item Template I added One GridView and SqlDataSource to populate data in GridView. DataList having one DataKey field, I want to pass this DataKey Value to the SqlDataSource as Parameter.
I tried this by Using Following:
<SelectParameters>
<%--<asp:Parameter DefaultValue="" Name="LocatioID" DbType="Int32" />--%>
<asp:ControlParameter ControlID="dlJobsByLocation" Name="LocatioID" PropertyName="DataKeys[0]" />
</SelectParameters>
<SelectParameters>
<asp:ControlParameter ControlID="dataList" Name="ID" PropertyName=
"DataKeys[0]"
/>
</SelectParameters>
In above snippet I hard coded Property Name to DataKeys[0], due to this it return DataKey value of first row only.
Here I need ProperyName which gives the DataKeys value for every row at the time of ItemDataBound. The Value 0 should be replaced with something thats where I stuck.......
Any Help Appreciated.........
Thanks,
VIkram
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
stored procedure
how to remove browse text and decrease the size browse button of fileupload control in asp.net