時,爲什麼這個工作不適合我的工作給我嗎?我的代碼在下面有什麼問題?我正在嘗試讀取存儲的proc並將值應用於標籤。獲取錯誤說 「CareerInner附近有語法錯誤」 .........,讀取存儲PROC不傳遞值
Private Sub LoadData()
' Define data objects
Dim conn As SqlConnection
Dim Comm As SqlCommand
Dim reader As SqlDataReader
conn = New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Comm = New SqlCommand(_
("CareersInner"), conn)
Comm.Parameters.AddWithValue("@ID", Request.QueryString("ID"))
conn.Open()
reader = Comm.ExecuteReader()
If reader.Read() Then
lbltitle.Text = reader.Item("title").ToString
lbldescription.Text = reader.Item("description").ToString
End If
reader.Close()
conn.Close()
End Sub
編輯: 我的存儲過程
ALTER PROCEDURE [dbo].[CareersInner]
@ID varchar(10)
AS
BEGIN
SET NOCOUNT ON;
SELECT * FROM Careers WHERE ID = @ID
END
你什麼錯誤? – M4N 2009-10-07 10:58:28
System.Data.SqlClient.SqlException = { 「附近有語法錯誤CareersInner'。」} – Etienne 2009-10-07 11:02:01
被命名爲 ' 「CareersInner」' 或 ' 「CareerInner」' 的PROC? – RobS 2009-10-07 11:05:11