468,283 Members | 1,874 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

calling a scalar function in sql from vb

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

Sep 17 '07 #1
0 3591

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Satish Chimakurthi | last post: by
3 posts views Thread by Ken | last post: by
reply views Thread by mav | last post: by
3 posts views Thread by =?Utf-8?B?cm9kY2hhcg==?= | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.