Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
i have 3 table namely USERS, Groups, and Student
private bool BindData(string query)
            String connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ToString();
            SqlConnection con = new SqlConnection(connectionString);            
            SqlDataAdapter adapter = new SqlDataAdapter(query, con);
            DataSet ds = new DataSet();
            studentDetailsView.DataSource = ds;            
            return true;
            return false;
the adapter.fill(ds) displays the correct result is shown when debugged but when its time to show in detailview it only displays first record of student against selected group
please suggest me how to display all the student data against selected group.
i have used this to display the data
<asp:DetailsView><asp:TemplateField HeaderText="LoginID">
                        <asp:Literal ID="litLoginID" runat="server" Text=' <%# Eval("LoginID")  %> ' />
and displayed all the info that is returned by the query
Posted 23-Feb-13 4:40am
Edited 24-Feb-13 1:02am
Sandeep Mewara at 23-Feb-13 11:53am
Try changing this line from this:
<pre lang="c#">studentDetailsView.DataSource = ds;</pre>
<pre lang="c#">studentDetailsView.DataSource = ds.Tables[0];</pre>
engr.hinaiqbal at 24-Feb-13 6:57am
Sandeep Mewara at 24-Feb-13 7:12am
Do share if that works.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 210
1 Richard MacCutchan 100
2 kbrandwijk 90
3 ProgramFOX 80
4 Sandeep Singh Shekhawat 70
0 Sergey Alexandrovich Kryukov 9,050
1 OriginalGriff 8,151
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928

Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100