本文介绍了我做了这段代码,但它给了我一个错误,说未声明gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Public Sub lp_populate(ByVal ps_SQLStr As String)
        Dim ls_constr As String
        ls_constr = "Data Source=DEFAULT-PC;Initial Catalog=IDMS_DEV;User ID=sa;Password=develop"
        Dim lo_sqladapter As SqlDataAdapter
        Dim lo_con As SqlConnection
        lo_con = New SqlConnection(ls_constr)
        lo_con.Open()
        Dim lo_dataset As New DataSet
        lo_sqladapter = New SqlDataAdapter(ps_SQLStr, lo_con)
        lo_sqladapter.SelectCommand.ExecuteNonQuery()
        lo_sqladapter.Fill(lo_dataset)

        GridViewEmp.DataSource = lo_dataset
        GridViewEmp.DataBind()
    End Sub

推荐答案



这篇关于我做了这段代码,但它给了我一个错误,说未声明gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 13:51