User1038
User1038

Reputation: 455

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

Upvotes: 0

Views: 2101

Answers (1)

D Stanley
D Stanley

Reputation: 152634

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;

Upvotes: 8

Related Questions