Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL & VB

Author  Topic 

craigsql
Starting Member

6 Posts

Posted - 2009-07-09 : 20:26:18
Hello all,

I am new to SQL, and there is an item that I am trying to grasp. I have created a stored procedure from SQL, and the output variable gives me an answer in one row, one column. I now want to pull this number into a label in VB.

What is the process in reading this variable into a label in VB form?


Ex:

DECLARE @Profit smallmoney

SET @Profit =
(
SELECT (Revenue - Expense)
FROM Sales
)

SELECT @Profit AS 'Profit'



Now for VB,
I would like to insert the @Profit variable into a label lblRevenue.


I know this has to simply because I actually got a row of data to be inserted into a dgv in VB. If anyone would like me to e-mail the VB code & SQL, let me know. Hope this information helps and appreciate the help as a young programmer!!

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-09 : 23:34:43
rs("profit")
Go to Top of Page
   

- Advertisement -