T
Toby Boogerd
Below I note that my response.write is adding spaces after the characters. I
use this code as Middleware, an application calls this page passing the
LogonID and the page is suppose to returen the password from the database.
It does but then when I open the file where I save this i notice I have
extra spaces after the password? Is there a better way to pass this data
back to my app?
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%
Dim conMMTMP As SqlConnection
Dim cmdSelect As SqlCommand
dim parmPassword As SqlParameter
conMMTMP = New SqlConnection(
"server=localhost;UID=sa;PWD=1amINIT2;database=mmtmp")
cmdSelect = New SqlCommand( "GetParam" , conMMTMP)
cmdSelect.CommandType = CommandType.StoredProcedure
cmdSelect.Parameters.Add( "@LogonID", Request.Querystring("LogonID"))
parmPassword = cmdSelect.Parameters.Add("@passwd", SqlDbType.Varchar)
parmPassword.Size = 40
parmPassword.Direction = ParameterDirection.Output
conMMTMP.Open()
cmdSelect.ExecuteNonQuery()
'Some reason it adds 12 spaces after the password!
response.write(cmdSelect.Parameters("@passwd").value)
conMMTMP.Close()
%>
use this code as Middleware, an application calls this page passing the
LogonID and the page is suppose to returen the password from the database.
It does but then when I open the file where I save this i notice I have
extra spaces after the password? Is there a better way to pass this data
back to my app?
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%
Dim conMMTMP As SqlConnection
Dim cmdSelect As SqlCommand
dim parmPassword As SqlParameter
conMMTMP = New SqlConnection(
"server=localhost;UID=sa;PWD=1amINIT2;database=mmtmp")
cmdSelect = New SqlCommand( "GetParam" , conMMTMP)
cmdSelect.CommandType = CommandType.StoredProcedure
cmdSelect.Parameters.Add( "@LogonID", Request.Querystring("LogonID"))
parmPassword = cmdSelect.Parameters.Add("@passwd", SqlDbType.Varchar)
parmPassword.Size = 40
parmPassword.Direction = ParameterDirection.Output
conMMTMP.Open()
cmdSelect.ExecuteNonQuery()
'Some reason it adds 12 spaces after the password!
response.write(cmdSelect.Parameters("@passwd").value)
conMMTMP.Close()
%>