output parameter into label
Posted
by
MyHeadHurts
on Stack Overflow
See other posts from Stack Overflow
or by MyHeadHurts
Published on 2011-01-10T19:35:20Z
Indexed on
2011/01/10
19:53 UTC
Read the original article
Hit count: 195
instead of returning my output paremeter value in my stored procedure to my label it returns the default value i set my output parameter to.
why cant i put my output parameter into my text label
Dim reader As SqlDataReader
cmd.Parameters.AddWithValue("@tour", "2365")
cmd.Parameters.Add("@tourname", SqlDbType.VarChar)
cmd.Parameters("@tourname").Direction = ParameterDirection.Output
cmd.CommandText = "test"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = conn
conn.Open()
reader = cmd.ExecuteReader()
Dim myTable As DataTable = New DataTable()
myTable.Load(reader)
DropDownList1.DataSource = myTable
DropDownList1.DataTextField = "ddate7"
DropDownList1.DataBind()
Label1.Text = cmd.Parameters("@tourname").ToString
conn.Close()
© Stack Overflow or respective owner