Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# DataGridView区分大小写的搜索_C#_Postgresql_Search_Datagridview - Fatal编程技术网

C# DataGridView区分大小写的搜索

C# DataGridView区分大小写的搜索,c#,postgresql,search,datagridview,C#,Postgresql,Search,Datagridview,如果您能提出建议,我将不胜感激 if (comboBox1.Text == "Location") { CRUD.cmd = new NpgsqlCommand( "SELECT * FROM archive WHERE location LIKE '%" + txtsearch.Text + "%'", CRUD.con); NpgsqlDataAdapter da = new NpgsqlDataAda

如果您能提出建议,我将不胜感激

if (comboBox1.Text == "Location")
{
    CRUD.cmd = new NpgsqlCommand(
       "SELECT * FROM archive WHERE location LIKE '%" + txtsearch.Text + "%'", CRUD.con);
    NpgsqlDataAdapter da = new NpgsqlDataAdapter();
    DataTable dt = new DataTable();
    da.SelectCommand = CRUD.cmd;
    dt.Clear();
    da.Fill(dt);
    grid.DataSource = dt;
}

这是我在DataGridView中搜索的代码,一切正常,但区分大小写。我尝试了
txtsearch.Text.ToLower()
,但它根本不显示大写搜索,有什么提示吗?

警告!我不确定我是否理解你的意思,我对C#和PostgreSQL有点陌生,这是我为textbox搜索找到的示例代码,当我测试它时,它运行良好。我应该换一种方式吗?
是区分大小写的,
是不区分大小写的,我从来没想过一个字符能解决我的问题。真是陈词滥调。非常感谢您,先生!非常感谢。