Last post Sep 03, 2015 09:30 AM by Rion Williams
Aug 28, 2015 07:40 AM|Surya18|LINK
Hey Guys ,
How to use multiple comma delimited value in single parameter of stored procedure
Aug 28, 2015 08:48 AM|Rion Williams|LINK
You should be able to do something like using one of the techniques mentioned in this blog post depending on what your exact scenario is which relies on writing
Can you elaborate a bit more on what your stored procedure looks like? Are you trying to populate an IN clause or something else? Would it be an option to simply perform your split and iterate through each (if you were adding records) :
// Split your comma delimited values
var splitValues = yourCommaDelimitedString.Split(',');
// Iterate through each value and perform a query using it
foreach(var splitValue in splitValues)
// Open a connection
using(var connection = ...)
// Build your query / stored procedure
var query = "..."
// Instantiate it
using(var command = ...)
// Open your connection
// Add your parameters and execute your query
Sometimes it's much easier to deal with comma-delimited values server-side (if you can) as opposed to trying to perform some of these types of operations in SQL.
Sep 03, 2015 06:31 AM|Surya18|LINK
Hi rion ,
can you explain,
i have dropdownlist from which i m passing data to parameter for eg.
so how to use with split
Sep 03, 2015 09:30 AM|Rion Williams|LINK
Could you post what your existing SQL statement looks like as that would affect how you pass the values in?