Home Forums Programming Connecting Connecting to SQL Server from a Visual Studio 2012 Express Class RE: Connecting to SQL Server from a Visual Studio 2012 Express Class

  • Thanks Lowell, it does help. I have one more question. My .net is non-existent and so please forgive me if this is a dumb question.

    I have in my code:

    Imports System.Data

    Imports System.Data.SqlClient

    and I'm a lot further on now thanks to your post. However, I'm getting:

    Import of type 'System.ComponentModel.Component' from assembly or module 'System' failed.

    This is occurring on the following line:

    Dim cmd As New SqlCommand

    I thought that SqlCommand would come in Data.SqlClient, but it appears not. I get a similar error on the DataReader too. I tried adding ComponentModel in my imports, but clearly it's not as simple as that.

    What else do I need to add to the imports?