0
我已存儲過程sp_ItemFilter,但問題是,當我插入文本框數據,我按btnButton發送數據,在GridView未顯示爲空,我怎麼能解決這個問題? 使用的代碼。文本框搜索的GridView與存儲過程ASP.NET
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
感謝閱讀我的文章