G
Guest
i have this store procedure.
=============================
CREATE PROCEDURE TEST
@TNUMBER NVARCHAR (10) ,
@TRANSNUM NVARCHAR(10) Output,
@OrderCom Nvarchar(500) Output,
@RTask Nvarchar(100) Output
AS
SET @TRANSNUM = @TNUMBER
SET @TRANSNUM = 'TEST'
SET @RTASK = 'TESTTEST'
-- also used SELECT Instead of SET
GO
==============================
and this is the webpage code:
=================================
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>TEST</title>
</head>
<body>
<%
Dim ordercom As String, rtsk As String, tnum as string
Dim cnStr As String
Dim SqlConnection1 As New Data.SqlClient.SqlConnection(cnStr)
Dim GETOLDSHIPRECORD As SqlClient.SqlCommand
cnStr =
ConfigurationManager.ConnectionStrings("SilverQueen_Main_SystemConnectionString1").ConnectionString
GETOLDSHIPRECORD = New SqlClient.SqlCommand
GETOLDSHIPRECORD.CommandType = CommandType.StoredProcedure
GETOLDSHIPRECORD.CommandText = "TEST"
GETOLDSHIPRECORD.Connection = SqlConnection1
GETOLDSHIPRECORD.Parameters.Add("@TNUMBER", SqlDbType.NVarChar).Value =
"493118"
GETOLDSHIPRECORD.Parameters.Add("@TRANSNUM", SqlDbType.NVarChar).Value =
""
GETOLDSHIPRECORD.Parameters.Add("@OrderCom", SqlDbType.NVarChar).Value =
""
GETOLDSHIPRECORD.Parameters.Add("@RTask", SqlDbType.NVarChar).Value = ""
SqlConnection1.Open()
GETOLDSHIPRECORD.ExecuteNonQuery()
tnum = GETOLDSHIPRECORD.Parameters("@TRANSNUM").Value
ordercom = GETOLDSHIPRECORD.Parameters("@TRANSNUM").Value
rtsk = GETOLDSHIPRECORD.Parameters("@RTask").Value
GETOLDSHIPRECORD.Dispose()
SqlConnection1.Dispose()
SqlConnection1.Close()
%>
<form id="form1" runat="server">
<div>
<%=ordercom%>
<%=rtsk %>
</div>
</form>
</body>
</html>
========================
but the results do not return to the page, I am still new to using asp.net 2
for this so maybe i am leaving out a step.
Tdar
=============================
CREATE PROCEDURE TEST
@TNUMBER NVARCHAR (10) ,
@TRANSNUM NVARCHAR(10) Output,
@OrderCom Nvarchar(500) Output,
@RTask Nvarchar(100) Output
AS
SET @TRANSNUM = @TNUMBER
SET @TRANSNUM = 'TEST'
SET @RTASK = 'TESTTEST'
-- also used SELECT Instead of SET
GO
==============================
and this is the webpage code:
=================================
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>TEST</title>
</head>
<body>
<%
Dim ordercom As String, rtsk As String, tnum as string
Dim cnStr As String
Dim SqlConnection1 As New Data.SqlClient.SqlConnection(cnStr)
Dim GETOLDSHIPRECORD As SqlClient.SqlCommand
cnStr =
ConfigurationManager.ConnectionStrings("SilverQueen_Main_SystemConnectionString1").ConnectionString
GETOLDSHIPRECORD = New SqlClient.SqlCommand
GETOLDSHIPRECORD.CommandType = CommandType.StoredProcedure
GETOLDSHIPRECORD.CommandText = "TEST"
GETOLDSHIPRECORD.Connection = SqlConnection1
GETOLDSHIPRECORD.Parameters.Add("@TNUMBER", SqlDbType.NVarChar).Value =
"493118"
GETOLDSHIPRECORD.Parameters.Add("@TRANSNUM", SqlDbType.NVarChar).Value =
""
GETOLDSHIPRECORD.Parameters.Add("@OrderCom", SqlDbType.NVarChar).Value =
""
GETOLDSHIPRECORD.Parameters.Add("@RTask", SqlDbType.NVarChar).Value = ""
SqlConnection1.Open()
GETOLDSHIPRECORD.ExecuteNonQuery()
tnum = GETOLDSHIPRECORD.Parameters("@TRANSNUM").Value
ordercom = GETOLDSHIPRECORD.Parameters("@TRANSNUM").Value
rtsk = GETOLDSHIPRECORD.Parameters("@RTask").Value
GETOLDSHIPRECORD.Dispose()
SqlConnection1.Dispose()
SqlConnection1.Close()
%>
<form id="form1" runat="server">
<div>
<%=ordercom%>
<%=rtsk %>
</div>
</form>
</body>
</html>
========================
but the results do not return to the page, I am still new to using asp.net 2
for this so maybe i am leaving out a step.
Tdar