locked
Call sql stored proc from LightSwitch: Namespace or type specified in the Imports 'System.Data.SqlClient' doesn't contain any public member or cannot be found RRS feed

  • Question

  • Hi Folks

    Inserting:

       Imports System.Data.SqlClient

    ...into LightSwitch app produces error:

    "Warning 1 Namespace or type specified in the Imports 'System.Data.SqlClient' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. C:\Users\Mark\Documents\Visual Studio 2012\Projects\Insight\Insight\Client\UserCode\CycleNew.vb 3 9 Client"

    Thus cannot call code:

      Using connection = New SqlConnection
      Dim connectionStringName = Me.DataWorkspace.InsightData.Details.Name
      connection.ConnectionString = ConfigurationManager.ConnectionStringsconnectionStringName).ConnectionString ...

    ... to call sql server stored procedure. Have checked that 'System.Data.SqlClient' is referenced. Same problem with Linq.

    Help much appreciated.

    Mark

    Monday, August 19, 2013 12:38 AM

All replies

  • TO CLARIFY:

    Only applies to LightSwitch Client project and not Server project?

    As screen button control needs to initiate SQL server data access/update, how do I include this code in Client?

    Tuesday, August 20, 2013 4:38 PM