Click here to Skip to main content
16,022,417 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I use this code to fill crystal report from query the report shows only the first column of the returned result.
Can anyone help me please to show all the returned results?
string cmd="select name from users ";
DataTable dt = new DataTable();
                DataSet1 ds = new DataSet1();
                 dt= dg1.DataSource as DataTable;
                SqlDataAdapter da = new SqlDataAdapter(cmd, DBConnection.GetSqlConnction());
                da.Fill(ds, "users");
                ds.Tables.Add(dt);
                CrystalReport1 cryst = new CrystalReport1();
                cryst.SetDataSource(ds.Tables);
                crystalReportViewer1.ReportSource = cryst;
                DBConnection.Connectionclose();
Posted
Updated 1-Sep-10 6:20am
v3

1 solution

Hi You have written the query as "select name from users" so obivously
you will get only first column of the returned resultset, chnage the query as "select * from users" to show all the columns returned results
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900