0

你能帮我么

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?]
4

1 回答 1

8

您缺少大写C字母 - C# 区分大小写:

SqlConnection
SqlCommand 
   ^
   |
   |

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

using System.Data.SqlClient;
于 2013-09-26T17:52:52.733 回答