IN clause in DataAdapter.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings all -

I'm running into an issue that appears, from the research I've found, to be a common issue but haven't found any resolution to. I have an ASP.Net listbox that houses employees that I can select to run a report against. I'm trying to figure out that since the IN clause seems to be out as far as using as a parameter, what other methods does .NET allow or interpret correctly like an IN clause so I can build my string based on the selections and be off on my way. I've only found "ugly" solutions with running T-SQL and I'm thinking that if this is so common, how does .NET address this

Any thoughts are sincerely appreciated. I'm at wits end with ideas to implement this functionality lookup to the database

Cheers
Jim
 
Hi Jim,

Do you need to pass IN string of values into stored procedure or you need to
build SQL statement? In case of stored procedure, there is only one (as I
know) proper and secure way to do this - passing IN values as an XML string
to the server and use sp_xml_preparedocument and OPENXML on server side.

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp


Jim said:
Greetings all -

I'm running into an issue that appears, from the research I've found, to
be a common issue but haven't found any resolution to. I have an ASP.Net
listbox that houses employees that I can select to run a report against.
I'm trying to figure out that since the IN clause seems to be out as far as
using as a parameter, what other methods does .NET allow or interpret
correctly like an IN clause so I can build my string based on the selections
and be off on my way. I've only found "ugly" solutions with running T-SQL
and I'm thinking that if this is so common, how does .NET address this?
Any thoughts are sincerely appreciated. I'm at wits end with ideas to
implement this functionality lookup to the database.
 
Back
Top