locked
Error SqlConnection is not defined RRS feed

  • Question

  • User709978785 posted

    Any Ideas? 

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: BC30002: Type 'SqlConnection' is not defined.

    Source Error:

    Line 38:     Dim ConnectStr As String
    Line 39:     Dim SelectStatement As String
    Line 40:         Dim MyConnection As SqlConnection = New SqlConnection(ConnectStr)
    Line 41:         Dim MyAdapter As SqlDataAdapter = New SqlDataAdapter
    Line 42:     Dim MyCommandBuilder As SQLCommandBuilder
    Wednesday, November 1, 2006 7:41 PM

Answers

  • User-2041805088 posted
    Do you have a reference to System.Data.SqlClient?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 1, 2006 7:43 PM

All replies

  • User-2041805088 posted
    Do you have a reference to System.Data.SqlClient?
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 1, 2006 7:43 PM
  • User709978785 posted

    Yes,

    I have System.Data and System.Data.SqlClient

    I should mention this is a web form I added from a VS 2003 project into VS.2005. This may or may not make a difference.

    Wednesday, November 1, 2006 8:17 PM