Passing data between .aspx and .vb files

  • Thread starter vengala s reddy
  • Start date
V

vengala s reddy

i have login.aspx, login.vb, i have my stored procedures in login.vb

in login.aspx
<%@ Page Language="vb" src="/MyTime/com/login.vb"
Inherits="Enter.MyTime"%>

in login.vb
Public Sub EnterMyTime(ByVal ID As String, ByVal PWD As String)as
dataset

Now i am trying to read the output variables data from login.aspx.
i could not do it. Is there any easy way to use sqlDataReader insted
of Returning a DataSet.

THX.
 
S

Stanley

Subs do not return anything so your syntax is incorrect. Show more of your
code so we can show you what to change.

-Stanley
 
V

VSKR

Public Function EnterMyTime(ByVal ID As String, ByVal PWD As String) As
SqlDataReader


Dim msg
Dim MyConn As New SqlConnection("Password=;Persist Security
Info=True;User ID=;Initial Catalog=;Data Source=;")
Dim cmd As SqlCommand = New SqlCommand("CheckLogin", MyConn)
cmd.CommandType = CommandType.StoredProcedure

Dim userID As SqlParameter = cmd.Parameters.Add("@uid",
SqlDbType.VarChar, 50)
userID.Value = ID
userID.Direction = ParameterDirection.Input

Dim password As SqlParameter = cmd.Parameters.Add("@pwd",
SqlDbType.VarChar, 50)
password.Value = PWD
password.Direction = ParameterDirection.Input

Dim status As SqlParameter = cmd.Parameters.Add("@status",
SqlDbType.VarChar, 2)
status.Direction = ParameterDirection.Output

Dim paySchedule As SqlParameter =
cmd.Parameters.Add("@paysch", SqlDbType.VarChar, 2)
paySchedule.Direction = ParameterDirection.Output

Dim empID As SqlParameter = cmd.Parameters.Add("@id",
SqlDbType.VarChar, 2)
empID.Direction = ParameterDirection.Output

MyConn.Open()
Dim result As SqlDataReader =
cmd.ExecuteReader(CommandBehavior.CloseConnection)


'MyConn.Close()
Return result
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top