我有存储过程sp_ItemFilter,但问题是当我在文本框中插入数据时,我按btnButton发送数据,gridview中未显示的变为空,我该如何解决这个问题?使用的代码。
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Cmd = New SqlCommand("sp_codefilter", Cnn)
Cmd.CommandType = CommandType.StoredProcedure
With Cmd.Parameters
.Add("@codigo", SqlDbType.VarChar, 6).Value = TextBox1.Text
Cnn.Open()
Try
Dim dv As New DataView
Da = New SqlDataAdapter(Cmd)
Ds = New DataSet
GridView1.DataSource = Ds.Tables()
GridView1.DataBind()
Catch ex As Exception
MsgBox(ex.Message)
Finally
Cnn.Close()
End Try
End With
End Sub
End Class
感谢您阅读我的帖子