我的datagrid查询所有就显示,查询部分不显示,这是怎么回事请大哥哥们指导!
下面是代码
Dim sqlconn As New SqlConnection("data source=03068AD0B34B4DE;initial catalog=bumen;uid=sa;pwd=;")
sqlconn.Open()
Dim cmd1 As New SqlCommand("select ryname from ry where rybm='ddlbm.selectedindex'", sqlconn) *用这行就不能显示查询,(其中ddlbm为下拉列表框)
' Dim cmd1 As New SqlCommand("select * from ry", sqlconn) *用这行就能在datagrid中全部显示
Dim sdr1 As SqlDataReader
sdr1 = cmd1.ExecuteReader()
DataGrid1.DataSource = sdr1
DataGrid1.DataBind()
sdr1.Close()
sqlconn.Close()
请问以上是怎么回事 急啊....