I have stored proc
I can use SQL Query Analyzer to test it. It works fine. When call it from my ASP.NET, it return nothing.
Here's my code...
Code:
CREATE PROCEDURE [dbo].[bookstore_select_Order_BySchoolName]
@SchoolName varchar(255)
AS
SELECT Orders.OrderID, Orders.dcOrderNumber, Orders.BilltoName, Orders.BilltoAddr1, Orders.BilltoCity, Orders.BilltoState, Orders.ccAmount, Orders.Total,
psSchool.SchoolName, psSchool.SchoolID,psSchool.CONO, psSchool.CSNO
FROM Orders INNER JOIN
psSchool ON Orders.CONO = psSchool.CONO AND Orders.CSNO = psSchool.CSNO
WHERE (psSchool.SchoolName like '%' + @SchoolName + '%')
ORDER By Orders.BilltoName
GO
I can use SQL Query Analyzer to test it. It works fine. When call it from my ASP.NET, it return nothing.
Here's my code...
Code:
Dim objConnection As New SqlConnection(Application("strSQLConnection"))
Dim sqlCommand1 As New SqlCommand("bookstore_select_Order_BySchoolName", objConnection)
Dim sqlAdapter As New SqlClient.SqlDataAdapter(sqlCommand1)
Dim sqlDataSet As New DataSet
sqlCommand1.CommandType = CommandType.StoredProcedure
sqlCommand1.Parameters.Add(New sqlClient.SqlParameter("@BillingAddr", SqlDbType.Char, 255))
sqlCommand1.Parameters("@BillingAddr").Value = "My School"
objConnection.Open()
sqlAdapter.Fill(sqlDataSet, "theTable")
If objConnection.State <> ConnectionState.Closed Then objConnection.Close()
objConnection.Dispose()
sqlCommand1.Dispose()
Return sqlDataSet
sqlAdapter.Dispose()
sqlDataSet.Dispose()