我正在使用 vb.net 从 DB 填充网格视图,问题是绑定 gridview 后我更改了项目 stlye 但它给出了这个错误
Index was out of range. Must be non-negative and less than the size of the collection
这是我的代码
Public Sub loadnews()
Try
con.Open()
Dim da As New OdbcDataAdapter("SELECT A.LABEL ""Highest"",A.VALUE||' '||A.DATED ""SML I (Jhang)"",b.VALUE||' '||b.DATED ""SML II (Bhone)"" FROM (SELECT * FROM CMS20122013.DNEWS_HIGHEST_J@CMS) A, (SELECT * FROM CMS20122013.DNEWS_HIGHEST_B@CMS) B WHERE A.SRLNUM=B.SRLNUM", con)
Dim ds As New DataSet
da.Fill(ds)
GridView11.DataSource = ds
GridView11.DataBind()
GridView11.Columns(1).ItemStyle.Font.Bold = True
con.Close()
Catch ex As Exception
Response.Write(ex.ToString())
Finally
con.Close()
End Try
End Sub
请任何人帮助我如何使0
列加粗