sqlconnection中的ASP.NET连接错误

Use*_*038 0 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 (are you missing a using directive or an assembly reference?]
Run Code Online (Sandbox Code Playgroud)

D S*_*ley 8

你错过了一个资本C- C#是区分大小写的:

SqlConnection
SqlCommand 
   ^
   |
   |
Run Code Online (Sandbox Code Playgroud)

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

using System.Data.SqlClient;
Run Code Online (Sandbox Code Playgroud)