M
Mark B
I have been able to retrieve the scalar value of a SQL Server Stored
Procedure as follows:
Shared Function fGetGroupPerformanceStatistic(ByVal strGroup As String) As
String
Dim sqlConnection1 As New SqlConnection("Data
Source=MARK\SQLEXPRESS;Initial Catalog=GroupSales;Integrated
Security=True;")
Dim cmd As New SqlCommand
cmd.CommandText = "ufWebStatsAverageSalesGroup"
cmd.CommandType = Data.CommandType.StoredProcedure
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.Parameters.Add(New SqlParameter("@EnterGroup", strGroup))
fGetGroupPerformanceStatistic = cmd.ExecuteScalar()
sqlConnection1.Close()
End Function
Now I want to retrieve the value from an SQL Server User Defined Function
udf.GetTopSalesFigure(@EnterGroup nvarchar(50))
How would I do that in VB code similar to the code above?
Also, can I do it by just dragging an SQLDataSource control onto the aspx
page and referencing that?
Procedure as follows:
Shared Function fGetGroupPerformanceStatistic(ByVal strGroup As String) As
String
Dim sqlConnection1 As New SqlConnection("Data
Source=MARK\SQLEXPRESS;Initial Catalog=GroupSales;Integrated
Security=True;")
Dim cmd As New SqlCommand
cmd.CommandText = "ufWebStatsAverageSalesGroup"
cmd.CommandType = Data.CommandType.StoredProcedure
cmd.Connection = sqlConnection1
sqlConnection1.Open()
cmd.Parameters.Add(New SqlParameter("@EnterGroup", strGroup))
fGetGroupPerformanceStatistic = cmd.ExecuteScalar()
sqlConnection1.Close()
End Function
Now I want to retrieve the value from an SQL Server User Defined Function
udf.GetTopSalesFigure(@EnterGroup nvarchar(50))
How would I do that in VB code similar to the code above?
Also, can I do it by just dragging an SQLDataSource control onto the aspx
page and referencing that?