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?
Thanks.
Rayne
|