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

calling a scalar function in sql from vb

P: n/a
I've got some scalar functions defined in sql server 2005. In VB.NET
they are set up as stored procedures that return a single value in my
tableadapter. When I preview data on the query in design mode, I get
the correct data returned, but when I try to use it in code, I'm not
getting correct data.

My code is as follows:

Public Function getClaimID(byVal Number as String) as Integer
Dim TA as New MainDataset.QueriesTableAdapter
Dim ID as Integer = 0

ID = CType(TA.getID(Number), Integer)

Return ID
End Function

No matter what value I use, it doesn't return the correct data. My
parameter is correct. I spit it out into a message box to check the
data going into the query.

What am I doing wrong? Is it because they are SQL functions and not
actual stored procedures?


Sep 17 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.