C# sqlconnection中的ASP.NET连接错误

C# sqlconnection中的ASP.NET连接错误,c#,asp.net,C#,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 (a

你能帮帮我吗

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?]
您缺少大写字母C-C区分大小写:

SqlConnection
SqlCommand 
   ^
   |
   |
您还需要确保已引用System.Data.DLL并在类顶部的using块中包含命名空间:

using System.Data.SqlClient;

这个问题似乎离题了,因为它是关于拼写错误的。正如D Stanley在回答中指出的,C是区分大小写的。@Renan B.S这是使用System.Data.SqlClient的代码上的拼写错误?然后在类名上使用cntrl-space键?@DaveZych我仔细考虑了一下,你是对的。我撤回了投票结果。