PC Review


Reply
Thread Tools Rate Thread

calling a scalar function in sql from vb

 
 
Rayne
Guest
Posts: n/a
 
      17th Sep 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling/using a sql server scalar valued function John Microsoft Access Form Coding 0 4th Oct 2010 08:39 PM
scalar function call rodchar Microsoft C# .NET 2 21st Mar 2008 08:25 PM
Scalar-Valued UDF Function =?Utf-8?B?R3JlZw==?= Microsoft Access ADP SQL Server 2 21st Sep 2006 04:56 AM
Problem calling scalar query in VS.NET 2005 dtalas@gmail.com Microsoft Dot NET 1 2nd Jan 2006 06:42 PM
scalar function return value into a VBA variable =?ISO-8859-1?Q?Sztranyovszky_Tam=E1s?= Microsoft Access ADP SQL Server 1 20th Apr 2005 12:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:23 PM.