c# - Searching lists, ranges -


I have an ASP.NET application, which will need to find a VARCHAR (20) column using lists and categories. In other words, the input can be something like this:

  ABC, 444, CD-EF, 90-BA, HEage  

and the result is required The equivalent of:

  from SELECT * table where call 1 = 'ABC' or 'call1 =' 444 'or' call 'with' CD 'and' EF 'or call 1' Regular SQL column sorting order is acceptable for the range, here are two main pieces:  
  1. For the category of 90 'and' BA 'or' Columns' = 'HIJ' ''
  2. Using the parameter in SP to search.

I have suggested options which are not mutually exclusive:

  1. I can send the string as I like. There is no array [] = SPLIT (',', @query) or similar, so parsing will be low. I want to parsing on the .NET side.
  2. Convert XML to .NET side, convert it to table in SP.
  3. Use the cursor to move through the parameters Already in the table, separate inquiries, and merge the results.
  4. To create a dynamic where the clause (# 1, or with the .NET side on the SQL side)

Dynamic SQL ".NET" on the NET side Goes out, but I'm not sure it's the best. Any ideas?

I think it is an easy way to make SQL statements on behalf of NAT. While performing set-base operations, SQL performs best (e.g., running a selection statement) SQL is not the best choice when doing procedural coding.

When you address all your options in addition to creating dynamic SQL on NAT, then you are asking SCL to do procedural stuff.

Since you can do the .NET procedural stuff and the SQL Server set-based stuff, there is a way to do this.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -