First, take the square brackets off your stored proc name in the C# code.
Second, put a try/catch block in your c# method so you can see what exception is being thrown. That will tell you exactly what the problem is.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 - You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 - When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
Start by checking that you are testing against the same database - it's surprising how often the SSMS check is done against the production DB instead of the development DB which has different data!
Then check that the SP in your Dev DB looks exactly like you think it does.
If all of that looks good, comment out the content of your SP, and replace it with this:
--select * from q_Warehouse80_OOS_ItemsNeedingNotification where item_id = @ItemsIDS
select '-' + item_id + '-' as R1, '-' + @ItemsIDS + '-' as R2 from q_Warehouse80_OOS_ItemsNeedingNotification where item_id = 'B30-244-595-CB-B001'
And this is what I get back when I call the SP from my C#:
And if you use the debugger to look at your itemsToBeChecked variable in the C#, you'll find the quotes are part of the string - which means they are part of the parameter you pass to SQL, and that explains why it doesn't match.
Now all you need to do is look at where that comes from and find out why the quotes are there. They're easy to get rid of - .Trim('''') will remove them - but it's better to find out what adds them and stop it doing it!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
I'm embarrassed to say that my C# code was adding the quotes around the argument being passed because a long time ago(I think it was Monday) I wanted the SP to take a list of strings and check to see if any of them matched the item_ids in the view the SP was searching.
Here is how my SP was originally looking before I started messing with it.
@ItemsIDS AS VARCHAR(max)
SET NOCOUNT ON
select item_id from q_Warehouse80_OOS_ItemsNeedingNotification where item_id in(@ItemsIDS)
As you can see I am using the in qualifier which requires the arguments being passed in the @ItemsIDS string to be separated by single quotes.
That's why the quotes were in the argument that I was passing to the SP.
So here I am back to square one trying to figure out why the SP doesn't work when I pass (in this case) one argument in the @ItemsIDS variable.
suppose i have a store procedure which has one out type parameter and out type parameter value is set inside store proc so when i will call that store proc by EF code first then how could read the out type parameter value by EF code first ?
looking for a small sample. i search google a bit but found no example. thanks
Seriously? I just read your question about what the difference is between Agile and Scrum. Have you heard of Google? You have been on this site long enough to know that you should at least think of doing some research beforehand yourself. This is a simple question for you to look up and I would strongly recommend that you learn to do the most basic searches yourself.