Gives me a NULL value at this line. and I know it has a 1
myShippingDetails.theShippingType = CStr(parametertheShippingType.Value)



Public Function GetSalesShippingInfo(ByVal SalesCookieID As String) As
ShippingDetails

' Create Instance of Connection and Command Object
Dim myConnection As New
SqlConnection(ConfigurationSettings.AppSettings("c onnectionString"))
Dim myCommand As New SqlCommand("GetSalesShippingInfo",
myConnection)

' Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure

' Add Parameters to SPROC
Dim parameterSalesCookieID As New SqlParameter("@SalesCookieID",
SqlDbType.NVarChar, 50)
parameterSalesCookieID.Value = SalesCookieID
myCommand.Parameters.Add(parameterSalesCookieID)

Dim parametertheShippingType As New
SqlParameter("@theShippingType", SqlDbType.Int, 4)
parametertheShippingType.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parametertheShippingType)

Dim parametertheTotalShipping As New
SqlParameter("@theTotalShipping", SqlDbType.Float)
parametertheTotalShipping.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parametertheTotalShipping )

Dim parametertheShipping As New SqlParameter("@theShipping",
SqlDbType.Int, 4)
parametertheShipping.Direction = ParameterDirection.Output
myCommand.Parameters.Add(parametertheShipping)

' Open the database connection and execute the command
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()



' Create CustomerDetails Struct
Dim myShippingDetails As ShippingDetails = New ShippingDetails

' Populate Struct using Output Params from SPROC
myShippingDetails.theShippingType =
CStr(parametertheShippingType.Value)'********* Give null
myShippingDetails.theTotalShipping =
CStr(parametertheTotalShipping.Value)
myShippingDetails.theShipping = CStr(parametertheShipping.Value)

Return myShippingDetails

End Function



CREATE PROCEDURE GetSalesShippingInfo
(
@SalesCookieID nvarchar,
@theShippingType int OUTPUT,
@theTotalShipping float OUTPUT,
@theShipping float OUTPUT
)
AS


SELECT
@theShippingType = shippingType
FROM
tempSales
WHERE
tempSalesQuidID = @SalesCookieID

if @theShippingType = 1
BEGIN
SELECT @theShipping = SUM(tempSalesDetail.theShipping)
FROM tempSales INNER JOIN
tempSalesDetail ON tempSales.tempSalesID =
tempSalesDetail.tempSalesID
WHERE tempSales.tempSalesQuidID = @SalesCookieID
END
if @theShippingType = 2
BEGIN
SELECT totalShipping
FROM tempSales
WHERE tempSalesQuidID = @SalesCookieID
END
GO

--

______________________
David Fetrow
HelixPoint LLC.
[url]http://www.helixpoint.com[/url]
[email]davef@helixpoint.com[/email]

Interested in Affordable Email Marketing?
Check out the HelixMailer at [url]http://www.helixpoint.com/helixmailer.asp[/url]
If you are interested in becoming a Reseller of HelixPoint products, contact
[email]davef@helixpoint.com[/email]
______________________