Home > Net >  Is there any problem, please name the parameter, the data can't check it out
Is there any problem, please name the parameter, the data can't check it out

Time:05-20

CodePudding user response:

When used in sqlparameter can't pass, so have to break out, otherwise the parameter directly when the string processing, such as 1, 2, 3, you he will not be parsed into a name resolution in (' 1 ', '2', '3') but will be parsed into name in (' 1, 2, 3), so of course can't check it out

CodePudding user response:

Then you are in the for loop name, paramList should be in the loop

CodePudding user response:

You do not intend to eventually generate SQL print it out to see?

1. Little skill, string. Join (", ", name) to replace your middle part, (blog garden saw, again the pot to the string)
2. Finally the individual with the parameterized preach to participate, because it is a string, so finally generated is in (' 1, 2, 3, 4) actually, it's clear that he is not in conformity with the rules of in, this can be directly replace or directly spliced

Words you don't let this code to make blog garden mix leadership see, they saw it, your bonus will have to fly

CodePudding user response:


@ name=string. Join (", ", name);
 
Select distinct mi EngineerName, count (*) as the count from MeetImage_info as an inner join the Split (@ the name, ', ') as sp on sp. The Result=mi. EngineerName

  •  Tags:  
  • C#
  • Related