2
Answers

how to pass comma seperated string as single parameter in a SELECT IN in stored procedure

kalpesh Bhadani

kalpesh Bhadani

15y
5.1k
1
Hello Everybody..

my question is like this. I have one String str which contains multiple customer Id like C00001,C00002,C00003.. seperated by comma.
Now i wants to pass this string str as single parameter to my stored procedure. I tried below code but it doen't works.
can anybody please help me???????

eg
 foreach (string s in idlist)
        {
            str = str +"'"+ s +"'" + ",";
        }
        str = str.Substring(0, str.Length - 1);

Now i wants to pass this str to my stored procedure as parameter

stored procedure is like this
select * from Customer_Master where CustomerId IN(@CustomerId)


Answers (2)
0
Bechir Bejaoui
NA 20.1k 5.3m 16y
The problem is when you open the file and leave it for other tasks you leave it in an open state so that you can't reuse it later, be sure to close it after each operation
you can try to use a StreamWriter object to write your content, it will append contents without getting this error.
Take a look on this

http://www.velocityreviews.com/forums/t294100-the-process-cannot-access-the-file-quotquot-because-it-is-being-used-by-another-process.html

they have the same problem as you





0
krishna shivarla
NA 9 14.9k 16y
Yes , I got that error.................
0
Bechir Bejaoui
NA 20.1k 5.3m 16y

Did you recieved the error

The process Can not access the file because it is being used by another
process
0
krishna shivarla
NA 9 14.9k 16y

In my application I am usin dsoframer activex control..........using that dsoframer activex control I am opening my word document from server ........when i try to save that file it is giving error........so i save my file to client system folder.......so that now i need to save that file to server agian which is actually has to saved to server....................that is the reason i want to save the client system fule to server without the help of fileuploader or any UI component........instead of that I want to save the file which i saved in particular client folder..........please help me out in this with some sample code.............. 

0
Bechir Bejaoui
NA 20.1k 5.3m 16y

Cloud you please explain the situation it is a little unclair