我想将日期列显示在存储过程返回的文本框中。该错误显示列名称。 谢谢你的帮助!
SQL存储过程:
SELECT MAX(NrTimesUpdated) AS NrTimesUpdated,
CONVERT(varchar(20),MAX(DateModified),101) AS DateEntered
FROM Credentials
WHERE ID = @ID
END
VB代码:
Dim cmd As New SqlClient.SqlCommand
cmd = New SqlCommand("get_credentials", cn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@ID", SqlDbType.Int).Value = lblID.Text
Dim rdr = cmd.ExecuteReader
If rdr.Read Then
lblDate.Text = rdr("DateEntered").ToString().Trim()
End If
rdr.Close()