前端之家收集整理的这篇文章主要介绍了
[VB.NET]GridControl1的列的绑定 在线...,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
GridControl1的列的绑定 在线... Private Sub 结算_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load Me.lie() Dim
sqlConn As New
sqlClient.
sqlConnection( "server=.;database=botongqiantai;uid=sa;pwd= ")
sqlConn.Open() Dim
sql As String ''
sql = "select co_settlement.sttmname 结算方式,wh_cashdl.amount 结算金额 from co_settlement inner join wh_cashdl on co_settlement.sttmid=wh_cashdl.sttmid "
sql = "select co_settlement.sttmname from co_settlement " Dim sda As New
sqlClient.
sqlDataAdapter(
sql,
sqlConn) Dim ds As New DataSet sda.Fill(ds,"co_settlement ") Me.GridControl1.DataSource = ds ''在这里是把ds绑定到了整个的GridControl1上了 ''我想做的是把ds绑定的GridControl1的结算方式这一列上就可以了 怎么实现呢? End Sub Private Sub lie() dt.Columns.Add( "结算方式 ") dt.Columns.Add( "结算金额 ") Me.GridControl1.DataSource = dt End Sub 在线等待... __________________________________________________________________________ 换成DataGrid的也行 我是VS2003 VB。NET __________________________________________________________________________