Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

Last post 09-28-2009 3:21 PM by papabear. 9 replies.

Sort Posts:

  • Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-25-2009, 4:10 PM
    • Member
      38 point Member
    • bootzilla
    • Member since 09-02-2008, 1:46 PM
    • Posts 341

     I received these two errors: 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found' for the code below. What do I need to correct these errors.

     

    Imports Microsoft.ApplicationBlocks.Data
    Imports System.Configuration.ConfigurationSettings
    
    Namespace AFA.Data
        Public Class Sql
            Public Shared Function GetMemberByUsernamePassword(ByVal username As String, ByVal password As String)
                Return SqlHelper.ExecuteScalar(AppSettings("Connection"), CommandType.StoredProcedure, "GetMemberByUsernamePassword", username, password)
            End Function
            Public Shared Function GetContentByContentId(ByVal contentId As Integer) As SqlClient.SqlDataReader
                Return SqlHelper.ExecuteReader(AppSettings("Connection"), "PCMS_GetContentById", contentId)
            End Function
            Public Shared Function PerformSearch(ByVal search As String) As DataSet
    
                Return SqlHelper.ExecuteDataset(AppSettings("Connection"), "PCMS_FreeText", search)
            End Function
        End Class
        Public Class Forms
    
        End Class
    End Namespace


     

  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-25-2009, 4:29 PM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 11:49 AM
    • Posts 851

    How are you accessing the ApplicationBlocks? They are not (if I remember correctly) strongly-typed by default, so you need to either

    1 - put the .dll in the bin folder of your website

    2 - give them a strong name and install them into your GAC

    I would suggest #1 for now...

    Hope that helps...

    m

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-25-2009, 4:35 PM
    • Member
      38 point Member
    • bootzilla
    • Member since 09-02-2008, 1:46 PM
    • Posts 341

    It does help. I see Microsoft.ApplicationBlocks.Data.dll in the bin folder but I still get that blue squiggly line that says it can't be found. Is there something else I am missing. 

  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-25-2009, 4:50 PM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 11:49 AM
    • Posts 851

    Have you added a 'reference' to it in the project? Otherwise it will pretend that it does not exist...

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-25-2009, 5:00 PM
    • Member
      38 point Member
    • bootzilla
    • Member since 09-02-2008, 1:46 PM
    • Posts 341

     yes i see it in the reference but there is a warning symbol next to it(a yellow triangle with a exclamation point inside of it). What does that mean. It's almost like it doesn't recognize it in References.

  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-25-2009, 5:10 PM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 11:49 AM
    • Posts 851

    Does it tell you when you hover over it or right-click it? Or even double-click. It definitely means that it is somehow being confused, hopefully that will tell you why...

    You might try removing and readding it to see if that helps...

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-28-2009, 10:08 AM
    • Member
      38 point Member
    • bootzilla
    • Member since 09-02-2008, 1:46 PM
    • Posts 341

    papabear:

    Does it tell you when you hover over it or right-click it? Or even double-click. It definitely means that it is somehow being confused, hopefully that will tell you why...

    You might try removing and readding it to see if that helps...

     

     

    All it does when I right-click on it says Remove or Properties. I removed it and now when I go to Add references I can't find it anymore. How do I re-add it?

  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-28-2009, 10:32 AM
    Answer
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 11:49 AM
    • Posts 851

    If it is in your 'bin' folder than you can browse to your bin folder when you select 'Add Reference' (click on the Browse tab). Select the dll and click 'OK'.

    :)

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-28-2009, 10:59 AM
    • Member
      38 point Member
    • bootzilla
    • Member since 09-02-2008, 1:46 PM
    • Posts 341

     It worked. Thank you

  • Re: Two errors - 'Sqlhelper not declared' and 'referenced component Microsoft.ApplicationBlocks.Data not found

    09-28-2009, 3:21 PM
    • Contributor
      5,138 point Contributor
    • papabear
    • Member since 08-08-2005, 11:49 AM
    • Posts 851

    you bet!

    give me suggestions for what to blog... http://www.myfriedmind.com/techblog -> thx

    Mark as "Answered" if this solves that wee old problem...
Page 1 of 1 (10 items)