回复 4楼 xiangyue0510
											
    Dim LeafSqlConnection As SqlConnection
  
    Dim LeafSqlCommand As SqlCommand
    Dim LeafSqlDataAdapter As SqlDataAdapter
    Dim LeafData As DataTable
              
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     
        'LeafSqlConnection = New SqlConnection("Initial Catalog=LENOVO-C4F87463 ;User ID=sa;PWD=123456")
  
        LeafSqlCommand = New SqlCommand("select
  * from
  vw_xsdtl")
        LeafSqlDataAdapter = New SqlDataAdapter
         = CommandType.Text
        LeafSqlDataAdapter.SelectCommand = LeafSqlCommand
        LeafData = New DataTable
        LeafSqlDataAdapter.Fill(LeafData)
        DataGridView1.DataSource = LeafData
    End Sub
End Class