如何打印顺序? [英] How to Print Order wise?

查看:96
本文介绍了如何打印顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难获得输出,请帮助我,



代码:

I am Very struggle to Get output,Kindly Help me,

Code:

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");
         }

推荐答案

更改查询的这一部分以获得有序打印。请参阅< FIELDNAME>



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

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>


我建​​议你去MSDN寻求更好的解决方案
I suggestion You are go to MSDN for better solution


这篇关于如何打印顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆