none
vb net like 变量,这样写怎么不行,求教 RRS feed

  • 问题

  • 我有以下代码,请改正

    dim x as string

    x=ComboBox1.SelectedValue

    Dim x As New SqlConnection _
       ("server=*\SQLEXPRESS;database=liansheng;user id=*;password=*")
            Dim y As New SqlDataAdapter()
            Dim z As New DataSet()
            y.SelectCommand = New SqlCommand()
            y.SelectCommand.Connection = x
            y.SelectCommand.CommandText =
                "select yonghu from liansheng.dbo.denglu where bumen like " & xx

            y.SelectCommand.CommandType = CommandType.Text

            ' Open the database connection..
            x.Open()

            ' Fill the DataSet object with data..
            y.Fill(z, "denglu")

            ' Close the database connection..
            x.Close()

            ComboBox2.DataSource = z
            ComboBox2.ValueMember = "denglu.yonghu"
    求改正

    2014年12月28日 16:38

全部回复