案例名称:使用DataView对象排序工程名称:Proj4-15 Imports System.Data.SqlClient Public Class Form1 '声明Connection,DataAdapter和DataSet对象。 Dim Conn As SqlConnection Dim da As SqlDataAdapter Dim ds As DataSet Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try '连接本地SQL Server数据库Conn = New SqlConnection() Conn.ConnectionString = "Data Source=(local);Initial Catalog=Sales;" & _ "Integrated Security=false;User ID=sa;Password=sa123" Dim strSQL = "select * from grade" Dim Comm As New SqlCommand(strSQL, Conn) Dim da = New SqlDataAdapter() da.SelectCommand = Comm Conn.Open() ds = New DataSet() da.Fill(ds, "grade") Dim dv As New DataView() dv = New DataView(ds.Tables("grade")) dv.RowFilter = "数学> 60" dv.Sort = "学号desc,数学DESC" Label1.Text = "满足条件的记录有:" + dv.Count.ToString() + "条" DataGridView1.DataSource = dv Conn.Close() Catch ex As Exception Mes