I have a datatable which is having n no. of rows and each row has a unique field say ID.
Now I want to get a particular row for a specified ID.
eg. there are 5 rows in a datatable and the id's are
1,2,3,4 and 5 and if I want to select a row having ID = 4
What will be the code snippet for that?
Does anybody have any idea?
Thanks in advance,
bhavna_816
0
Junior Poster
Recommended Answers
Jump to PostYou will need to modify your select statement. Are you using SQL table as your back end database?
Jump to Posti cant fully understand ur question as for as concerned i tried
select *from tablename where id='selectedid'
Jump to PostHi Bhavna. Hw do u do?
Well, first of all I would like to repeat what you've asked so that it'll be, you know, better for me to give my view...
You are trying to select records of a particular field from a datatable displayed in a grid, …
Jump to Posthi sis,
i give the code here
for asp page<asp:GridView DataKeyNames="nameid" OnRowCommand="list" ID="grid1" AutoGenerateColumns="false" runat="server" > <Columns> <asp:BoundField DataField="nameperson" HeaderText="firstname" /> <asp:BoundField DataField="lastnameperson" HeaderText="lastname" /> <asp:ButtonField ButtonType="Button" CommandName="list" HeaderText="list" /> </Columns> </asp:GridView> this is for asp.cs page protected void list(object sender, GridViewCommandEventArgs e) { if (e.CommandName …
All 16 Replies
majestic0110
187
Nearly a Posting Virtuoso
vmadhu_ece
0
Newbie Poster
bhavna_816
0
Junior Poster
ardeezstyle
0
Light Poster
vmadhu_ece
0
Newbie Poster
bhavna_816
0
Junior Poster
gunj
0
Newbie Poster
gunj
0
Newbie Poster
bhavna_816
0
Junior Poster
gunj
0
Newbie Poster
srikanthkadem
0
Junior Poster in Training
gunj
0
Newbie Poster
bhavna_816
0
Junior Poster
gunj
0
Newbie Poster
R.Binu_Pbl
0
Newbie Poster
rickyenjohns
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.