c#使用ComboBox和Textbox进行搜索

时间:2016-01-20 06:33:21

标签: c# search combobox textbox

我的代码有问题。每次我在0 0 0.0 -0.0 中输入文本时都会发生这种情况。这是一个添加的列,它是空的(我想删除它)

enter image description here

TextBox

1 个答案:

答案 0 :(得分:0)

首先,为什么不使用格式而不是使用combersome switch?接下来,不要 在查询中使用*,只需枚举您真正想要的所有列:

  cmd.CommandText = String.Format(
    @"select Id,      
             Quantity,
             Unit --TODO: Add other required columns here
        from Inventory
       where {0} like @searchKey", value);
相关问题