English 中文(简体)
如何寻找最符合第EF4.1号指示的方法?
原标题:How to search best match for the string EF4.1?

我有一个实体“公司”。 当用户进入公司名称时,我必须查询我的行文是否已经存在。 我无法用公司名称查询,因为第二次用户可能以不同方式进入点名或拼写错误。 即便如此,我也想找到最好的对应办法。

问题回答

This may not be possible generally. Look at this tow sample :

"Company Name" "Company Name"

您不能确定你们的一位使用者。 你可以做这样的事情:

  • Trim the spaced from begin and the end of entered company name and then save it to db
  • Do not allow users to enter some chars like "" / in the name of company
  • replace or more than one space chars exactly beside each other with one space char

after these such action , you can be hopeful that you can search it by some methods like String.Contains (this is not exact)

另一方面,你可以定期表达,迫使用户进入与这一表述相符的名称,但前提是你能够确切地查找姓名(说明并非所有表述都有助于你实现)。

Good luck Ali Foroughi

这大多是不可能的。 即使有一些比较先进的工具能够纠正共同拼错,但是由于这些工具是针对特定语言及其词汇(结构分析)——公司名称可以由非词汇(不存在)字和外语组成,因此纠正拼写错误的工具要么通过采用不正确的拼写法(将文字改为英文,用当地语言打字)。

另一个问题是如何在数据库中进行这种拼凑的改正工作。 席卷更正肯定不会成为共同查询算法的一部分。 它可以作为全文检索的一部分,但I m not敢肯定的是,如果服务器提供这种外围的箱子(

用户必须至少知道公司名称的一部分,然后才能使用@Ali描述的方法。 造成错误是他的过失。 你们能够使搜索过程更加方便用户,例如具有汽车完整、公司名称、目前分类的插图等特征。





相关问题
Entity Framework with MySQL connector in c#

I have been trying to get the Entity Framework to work in my web application using MySQL. It works fine on my local pc, but doesn t work when I put it on the server. Since the server is a shared ...

How Do I Create And Update A Many To Many Relationship With EF

I am using the Entity Framework with SQL Server. I have a many to many relationship between 2 tables. I have created a join table with just the primary key fields of the 2 tables. In the designer, the ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Linq to enties, insert foreign keys

I am using the ADO entity framework for the first time and am not sure of the best way of inserting db recored that contain foreign keys. this is the code that i am using, I would appreciate any ...

Entity Framework - Many to many question

I have a table called ASB and a table called PeopleInvolved. There is a junction table called PeopleInvolved_ASB which simply contains an ASBID and a PeopleInvolvedID column. The columns act as a ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

ADO.NET Entity Data Model are not precise enough

I run this code: var cos = from k in _db.klienci_do_trasy where k.klient_id == 5 select k; but the query send to database is: SELECT * FROM `klienci_do_trasy` LIMIT 0, 30 why is it for, there ...

热门标签