Why is Visual Studio's table adapter query not returning the same data as the stored procedure it represents?

I'm using a table adapter in Visual Studio to make a query to a stored procedure in my SQL Server 2005 database. When I make the call via my website application it returns nothing. When I make the same call via SQL Server Manager it returns the expected data.

I put a breakpoint on the call to the adapter's getData method and looked at all the parameters and their values and matched them in a query from server management to make sure. I'm sending the following query:

getData(string, date, date, int, int?, int?, string, int?, string)

further

getData('0000-rtg', '1/1/2007', '3/12/2008', 0, null, null, null, null, null)

I guess I'm wondering if Visual Studio does something with the null's before it tries to send the query to the SQL server. If not, how do I fix this problem?

EDIT: All these values are passed by variables, I just typed what was in those variables at that break point.

Answers


Use Sql Profiler to see how the sql sent to sql server actually looks like. This has helped me many times.


Dates need to have quotes around them in SQL else they don't work.


Need Your Help

Backbone.js function doesn't work unless called in script for first time

jquery twitter-bootstrap button backbone.js

I've got a button that I'd like to alert a message upon being clicked. If I call the function through the script it will alert the message, and then whenever I click on the button it will also aler...

When I use float left content jumps out of the block

html css web css-float

I have created my code sample on jsbin , here it is

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.