0

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?]
5
  • 1
    This question appears to be off-topic because it is about a typo. Commented Sep 26, 2013 at 17:53
  • 1
    Like D Stanley pointed out in his answer, C# is case sensitive. Commented Sep 26, 2013 at 17:53
  • @Renan B.S that's a typo on a code Commented Sep 26, 2013 at 17:54
  • Using System.Data.SqlClient ? And then use cntrl- space key on the class name? Commented Sep 26, 2013 at 17:54
  • @DaveZych I gave that a second thought, and you're right. I've retracted the close vote. Commented Sep 26, 2013 at 19:13

1 Answer 1

8

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;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.