Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am Very struggle to Get output,Kindly Help me,

Code:
C#
dAdapter = new OleDbDataAdapter
             ("SELECT TabTitle,A.ButtonName,A.CheckBoxName,B.SubCheckboxName FROM (Select * from PersonalTrainerCheckboxData where Checked=true and ButtonName<>'Startseite' and ButtonName<>'Ende') A LEFT JOIN (Select * From PersonalTrainerSubcheckboxData where SubCheckBoxChecked=true ) B ON A.ButtonName = B.ButtonName AND A.TabID = B.TabID And A.CheckBoxName = B.CheckBoxName ORDER BY A.TabID ASC", connParam);
         cBuilder = new OleDbCommandBuilder(dAdapter);
         dataTable = new DataTable();
         ds = new DataSet();
         dAdapter.Fill(dataTable);

         for (int i = 0; i < dataTable.Rows.Count; i++)
         {
             createReport.AppendLine(dataTable.Rows[i][0].ToString() + " : " + dataTable.Rows[i][1].ToString() + ", " + dataTable.Rows[i][2].ToString()+ " - " + dataTable.Rows[i][3].ToString());
             createReport.AppendLine("\t");
             createReport.AppendLine("\n");
         }
Posted
v2
Comments
[no name] 26-Jun-14 15:56pm    
Help you with what? We would have no idea what your struggle is, what output you are getting or what output you expect.
ZurdoDev 26-Jun-14 21:37pm    
What's the problem?
Sunasara Imdadhusen 27-Jun-14 1:57am    
Can you please provide more details for your question because no one can read your mind without complete details.

Change this part of the query to get ordered printing. See <FIELDNAME>

SQL
SELECT TabTitle,A.ButtonName,A.CheckBoxName,B.SubCheckboxName FROM (Select * from PersonalTrainerCheckboxData where Checked=true and ButtonName<>'Startseite' and ButtonName<>'Ende') A LEFT JOIN (Select * From PersonalTrainerSubcheckboxData where SubCheckBoxChecked=true ) B ON A.ButtonName = B.ButtonName AND A.TabID = B.TabID And A.CheckBoxName = B.CheckBoxName ORDER BY A.<fieldname> ASC</fieldname>
 
Share this answer
 
I suggestion You are go to MSDN for better solution
 
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