简体   繁体   中英

ASP.NET connection error in sqlconnection

Can you please help me

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

You're missing a capital C - C# is case-sensitive:

SqlConnection
SqlCommand 
   ^
   |
   |

You also need to make sure you've referenced System.Data.DLL and included the namespace in your using block at the top of the class:

using System.Data.SqlClient;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM