C#数据库中的搜索按钮具有访问权限

时间:2013-09-11 13:22:58

标签: c# .net vb.net

我需要帮助在C#中创建搜索按钮,因为在Visual Basic中我有这个代码

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
    Handles Button1.Click

    Me.CostumersBindingSource.Filter = "[ID]  = ' " & Me.TextBox1.Text & "'"

End Sub

但我希望c#或任何想法都一样!!!

1 个答案:

答案 0 :(得分:0)

这与C#

中的代码相同
private void Button1_Click(object sender, EventArgs e)
{
    this.CostumersBindingSource.Filter = "[ID]  = ' " + this.TextBox1.Text + "'";
}