In combination with. NET development, we will talk about the usage of the fuzzy query statement like in access.

Source: Internet
Author: User

A new project of the access library type was created, and the dateset. XSD dataset control was used for the three-layer development Dal layer. It was found that the dataset control does not support the like statement.

There is no way to discard the dataset control and use it againCodeMethod.

As you know

The wildcard usage of like in access is as follows:
"?" Represents any single character; "*" Represents zero or multiple characters; "#" represents any number

In SQL Server, % is used, and ** is used in access.

To prevent syntax errors, create a query in access and test it again. No problem (select * From tb_commodity shortname like '* 2009 *').

Run the codeProgramAnd how can't the results be returned? The SQL statements obtained by the interrupt tracking are the same as those obtained by the test. What is the problem ??

After research, we found that if you have to switch back to % again in tableadapter of vs2005, * cannot work !!! (Speechless ....)

I hope you will be able to solve this problem in the future.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.