本文介绍了desc的顺序在sqldatasource中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在使用转发器在webform中显示数据。但我有这个代码的问题。当我从BidTAble中选择*数据时,它会按描述顺序显示,但是当我使用INNER JOIN时,Desc不起作用。 :/ 我尝试过: i'm using repeaters to show data in webform. but i have a problem with this code. when i select * data from BidTAble it shows in Desc order but when i use INNER JOIN , Desc doesn't work.! :/What I have tried: <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CONN %>" SelectCommand="SELECT BidTable.BidID,BidTable.RegID,BidTable.CarID,Reg.username,BidTable.BidAmount FROM [BidTable] INNER JOIN Reg ON BidTable.RegID=Reg.ID WHERE ([CarID] = @CarID) ORDER BY [BidAmount] DESC"> <SelectParameters> <asp:QueryStringParameter Name="CarID" QueryStringField="id" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> 推荐答案 SELECT BidTable.BidID,BidTable.RegID,BidTable.CarID,Reg.username,BidTable.BidAmount FROM [BidTable] INNER JOIN Reg ON BidTable.RegID=Reg.ID WHERE (BidTable.CarID = @CarID) ORDER BY BidTable.BidAmount DESC 这篇关于desc的顺序在sqldatasource中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-21 14:00