且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TableAdapters.Fill不区分大小写

更新时间:2023-02-05 21:23:48

>> 我似乎无法使用UPPER(用户名)或LOWER(用户名),因为它们都是未知功能。 如何在查询生成器中执行此操作?可以吗?

你好shilton32,

Hi shilton32,

根据你的描述,你在你的wpf项目中使用TableAdapter,你想要输入小写字符串,然后就可以在数据库中找到当前数据了。

According to your description, you use TableAdapter in your wpf project, you want to enter lowercase string, then you can find the current data in database.

首先,我不建议你这样做,因为它不安全,但如果你还想这样做,你可以按照这些步骤进行操作。

Firstly, I don't suggest you do this, because it is not safe, but if you still want to do this, you can following the steps.

Fitsyly,我为TableAdapter创建了新的查询,如下所示:

Fitsyly, I create new query for TableAdapter, like this:

然后您可以使用NameQuery方法通过您输入的字符串获取数据。

Then you can use the NameQuery method to get the data by the string you enter.

  private void btn1_Click(object sender, RoutedEventArgs e)
        {
            DataSet1 dataset = new DataSet1();
            DataSet1TableAdapters.test16TableAdapter test16adapter = new DataSet1TableAdapters.test16TableAdapter();
           string name= test16adapter.NameQuery("cherry").ToString();
        }

这是我的表格:

最诚挚的问候,

Cherry