★GridView排序問題!★
CSDN - 技术社区 - 问题
推荐给朋友 | 关闭窗口
主 题: ★GridView排序問題!★
作 者: hs1983 ()
等 级:
信 誉 分: 100
人 气: 5
所属社区: .NET技术 ASP.NET
问题点数: 20
回复次数: 0
发表时间: 2007-7-4 10:22:56
請問我該怎麼實現按字段名稱手動排序??!請寫詳細些!謝謝了!
數據綁定部分為:
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text != " " && TextBox2.Text != " ")
{
SqlConnection Sqlcon = new SqlConnection(SqlconString.SqlconnectionString);
string strsql = "SELECT SFCYMJ.MJ011, SFCYML.ML005, SFCYML.ML006, SFCYML.ML015, SFCYMK.MK033, BCDMK.MK003, SFCYML.ML046, INVMB.MB002, SUM(SFCYMK.MK017) AS Expr1, SUM(SFCYML.ML016) AS Expr2 FROM BCDMK INNER JOIN SFCYMJ INNER JOIN SFCYML ON SFCYMJ.MJ001 = SFCYML.ML001 AND SFCYML.ML001 = '5172 ' AND SFCYMJ.MJ002 = SFCYML.ML002 INNER JOIN SFCYMK ON SFCYMJ.MJ001 = SFCYMK.MK001 AND SFCYMK.MK007 = 'A ' AND SFCYMJ.MJ002 = SFCYMK.MK002 AND SFCYML.ML003 = SFCYMK.MK003 INNER JOIN INVMB ON SFCYML.ML015 = INVMB.MB001 ON BCDMK.MK001 = SFCYML.ML015 ";
strsql += &nbs