By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,617 Members | 1,896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,617 IT Pros & Developers. It's quick & easy.

Problem calling scalar query in VS.NET 2005

P: n/a
Hi all

I'm having a problem where calling scalar stored procedures always
returns NULL.

I have the simple test stored procedure, that returns a single integer:
ALTER PROCEDURE dbo.Test
AS
RETURN 27
I then create a new DataSet:

* using VS.NET 2005, I use the wizard to create a new Query Table
Adapter
* I specify my Test stored procedure as the one to call
* I specify that this is a "single value" call, i.e. create a function
to return a single value
* I call the new function "Test"

In my test program I call it:

QueriesTableAdapter qta = new QueriesTableAdapter();
object obj = qta.Test();

HOWEVER, the return from Test is always null. Anyone else is having
this problem with VS2005?

Thanks in advance,
Daniel.

Jan 2 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

I usually use an .ExecuteScalar for those types.

dt****@gmail.com wrote:
Hi all

I'm having a problem where calling scalar stored procedures always
returns NULL.

I have the simple test stored procedure, that returns a single integer:
ALTER PROCEDURE dbo.Test
AS
RETURN 27
I then create a new DataSet:

* using VS.NET 2005, I use the wizard to create a new Query Table
Adapter
* I specify my Test stored procedure as the one to call
* I specify that this is a "single value" call, i.e. create a function
to return a single value
* I call the new function "Test"

In my test program I call it:

QueriesTableAdapter qta = new QueriesTableAdapter();
object obj = qta.Test();

HOWEVER, the return from Test is always null. Anyone else is having
this problem with VS2005?

Thanks in advance,
Daniel.

Jan 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.