资 源 简 介
VB 使用DataGrid显示书名数据表,这个例子相当简单,主要是学习在VB编程中如何使用DataGrid数据网格控件,将数据库内容读取出来,然后绑定到DataGrid表格中显示:
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=book"
Adodc1.RecordSource = "select * from 书名"
Set DataGrid1.DataSource = Adodc1
DataGrid1.Columns(3).NumberFormat = "$0.00"
DataGrid1.Columns(4).NumberFormat = "$0.00"
End Sub