ASP.NET SQL 连接中的连接错误
本文关键字:连接 错误 ASP SQL NET | 更新日期: 2023-09-27 18:33:00
你能帮帮我吗
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;