Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to draw an image using form controls? Pin
Le@rner16-Sep-16 19:40
Le@rner16-Sep-16 19:40 
GeneralRe: How to draw an image using form controls? Pin
OriginalGriff16-Sep-16 21:27
mveOriginalGriff16-Sep-16 21:27 
GeneralRe: How to draw an image using form controls? Pin
Le@rner16-Sep-16 0:09
Le@rner16-Sep-16 0:09 
AnswerRe: How to draw an image using form controls? Pin
Pete O'Hanlon15-Sep-16 22:04
mvePete O'Hanlon15-Sep-16 22:04 
QuestionCalling a stored procedure from C# failing Pin
Member 1274201915-Sep-16 5:35
Member 1274201915-Sep-16 5:35 
AnswerRe: Calling a stored procedure from C# failing Pin
#realJSOP15-Sep-16 5:43
mve#realJSOP15-Sep-16 5:43 
GeneralRe: Calling a stored procedure from C# failing Pin
Member 1274201915-Sep-16 5:45
Member 1274201915-Sep-16 5:45 
AnswerRe: Calling a stored procedure from C# failing Pin
OriginalGriff15-Sep-16 5:51
mveOriginalGriff15-Sep-16 5:51 
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:
SQL
select '-' + item_id + '-', '-' + @ItemsIDS + '-' from q_Warehouse80_OOS_ItemsNeedingNotification where item_id  = 'B30-244-595-CB-B001'
Then run your C# code again and see exactly what you get back.
If what you say is right, then it should be two identical strings:
-B30-244-595-CB-B001- and -B30-244-595-CB-B001-

But I'm betting it doesn't. Either way, that should isolate roughly where the problem is being caused - and that should give you (and us) at least more to work from.

I'd code it differently:
C#
cmd = new SqlCommand();

cmd.CommandText = SQL;
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Connection = conn;

var myparams = new SqlParameter("@ItemsIDS", DbType.String);
myparams.Direction = ParameterDirection.Input;
myparams.Size = 40;
myparams.Value = ItemsToBeChecked;
cmd.Parameters.Add(myparams);

Would become:
C#
cmd = new SqlCommand(SQL, conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(@ItemsIDS, ItemsToBeChecked);

It might be worth checking that as well, in case it's a field size mismatch / padding problem.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Calling a stored procedure from C# failing Pin
Member 1274201915-Sep-16 6:28
Member 1274201915-Sep-16 6:28 
GeneralRe: Calling a stored procedure from C# failing Pin
OriginalGriff15-Sep-16 6:42
mveOriginalGriff15-Sep-16 6:42 
GeneralRe: Calling a stored procedure from C# failing Pin
Member 1274201915-Sep-16 7:01
Member 1274201915-Sep-16 7:01 
GeneralRe: Calling a stored procedure from C# failing Pin
OriginalGriff15-Sep-16 8:05
mveOriginalGriff15-Sep-16 8:05 
GeneralRe: Calling a stored procedure from C# failing Pin
Member 1274201915-Sep-16 11:07
Member 1274201915-Sep-16 11:07 
GeneralRe: Calling a stored procedure from C# failing Pin
OriginalGriff15-Sep-16 11:29
mveOriginalGriff15-Sep-16 11:29 
GeneralRe: Calling a stored procedure from C# failing Pin
Luc Pattyn15-Sep-16 21:12
sitebuilderLuc Pattyn15-Sep-16 21:12 
GeneralRe: Calling a stored procedure from C# failing Pin
OriginalGriff15-Sep-16 21:15
mveOriginalGriff15-Sep-16 21:15 
QuestionHow to call store procedure which return multiple result set with EF code first Pin
Tridip Bhattacharjee15-Sep-16 5:11
professionalTridip Bhattacharjee15-Sep-16 5:11 
AnswerRe: How to call store procedure which return multiple result set with EF code first Pin
OriginalGriff15-Sep-16 5:42
mveOriginalGriff15-Sep-16 5:42 
GeneralRe: How to call store procedure which return multiple result set with EF code first Pin
Pete O'Hanlon15-Sep-16 5:43
mvePete O'Hanlon15-Sep-16 5:43 
GeneralRe: How to call store procedure which return multiple result set with EF code first Pin
OriginalGriff15-Sep-16 5:59
mveOriginalGriff15-Sep-16 5:59 
GeneralRe: How to call store procedure which return multiple result set with EF code first Pin
Pete O'Hanlon15-Sep-16 9:05
mvePete O'Hanlon15-Sep-16 9:05 
QuestionEF code first and out type parameter in store procedure Pin
Tridip Bhattacharjee15-Sep-16 5:11
professionalTridip Bhattacharjee15-Sep-16 5:11 
AnswerRe: EF code first and out type parameter in store procedure Pin
Dave Kreskowiak16-Sep-16 3:51
mveDave Kreskowiak16-Sep-16 3:51 
QuestionHow to read single value return by store proc with EF code first Pin
Tridip Bhattacharjee15-Sep-16 5:10
professionalTridip Bhattacharjee15-Sep-16 5:10 
AnswerRe: How to read single value return by store proc with EF code first Pin
Pete O'Hanlon15-Sep-16 5:42
mvePete O'Hanlon15-Sep-16 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.