The type or namespace name ‘SqlConnection’ could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlConnection’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlDataReader’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlCommand’ could not be found
(are you missing a using directive or an assembly reference?)

The type or namespace name ‘SqlDataAdapter’ could not be found
(are you missing a using directive or an assembly reference?)

I have a Solution Is Like Below.

When this type of any error occure,so you simply add below namespace.

add System.Data.SqlClient; namespace at the top of the class().

Hope your problem has been solved.

About the Author

avatar