2013-09-26 59 views
0

能否請你幫我ASP.NET連接錯誤

Sqlconnection con;//**error**[The type or namespace name 'Sqlconnection' could not be found (are you missing a using directive or an assembly reference?] 

Sqlcommand com;//**error**[The type or namespace name 'Sqlcommand' could not be found (are you missing a using directive or an assembly reference?] 
+1

這個問題似乎是脫離主題,因爲它是關於一個錯字。 – Renan

+1

就像D斯坦利在他的回答中指出的那樣,C#是區分大小寫的。 – Khan

+0

@Renan B.S這是代碼上的拼寫錯誤 – meda

回答

8

你缺少資本C - C#是區分大小寫的:

SqlConnection 
SqlCommand 
^
    | 
    | 

你還需要確保你「已經引用System.Data.DLL幷包含在您using塊的命名空間在類的頂部:

using System.Data.SqlClient;