Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8927129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:08:55+00:00 2026-06-15T08:08:55+00:00

This snippet is in my Business Logic Layer Class File: Public Shared Function getAccIDFromSocialAuthSession()

  • 0

This snippet is in my Business Logic Layer Class File:

Public Shared Function getAccIDFromSocialAuthSession() As Object
        Dim db As SqlDatabase = Connection.connection
        Dim accID As Integer
        If SocialAuthUser.IsLoggedIn Then
            Using cmd As SqlCommand = db.GetSqlStringCommand("SELECT AccountID FROM UserAccounts WHERE FBID=@fbID")
                db.AddInParameter(cmd, "fbID", SqlDbType.VarChar, SocialAuthUser.GetCurrentUser.GetProfile.ID)
                accID = db.ExecuteScalar(cmd)
            End Using
        End If

        Return accID
    End Function

I am using SocialAuth.Net. SocialAuth.NET stores everything in session. For e.g to get the Facebook User ID we call SocialAuthUser.GetCurrentUser.GetProfile.ID , since it is session based i get this error message “Object Reference Not Set to an instance of an object” when i try to call SocialAuthUser.GetCurrentUser.GetProfile.ID from a webservice (asmx.vb) file. I am calling it like this (ClassName.FunctionName–>BLL.getAccIDFromSocialAuthSession)

Whaen i call the same function from a aspx.vb page it works fine but not when i call it from an asmx.vb page.

Since i do not know the session variable name , i cannot use System.Web.HttpContext.Current.Session("NameHere")

Any solution??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:08:56+00:00Added an answer on June 15, 2026 at 8:08 am

    Here’s the start of some working code:

    Imports System.Web.Services
    Imports System.ComponentModel
    
    <System.Web.Script.Services.ScriptService()> _
    <System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
    <System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
    <ToolboxItem(False)> _
    Public Class LightboxService
        Inherits WebService
    
        <WebMethod(EnableSession:=True)> _
        Public Function AddToLightbox(ByVal filename As String) As String
            Dim user As String = CStr(Session("username"))
    
    '...etc.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this snippet of code: public static class MatchCollectionExtensions { public static IEnumerable<T> AsEnumerable<T>(this
WCF/C# N-Tier app. We have implemented Paging in our business Layer using this snippet
In this snippet: find( sub { print found . $File::Find::name . \n; }, (.));
I am using Linq-To-Sql to populate my business layer. Here is a snippet of
I have the following HTML (a snippet): <td class=ms-vb-title height=100%> <table class=ms-unselectedtitle onmouseover=OnItem(this) ctxname=ctx1
This snippet is causing the file to throw a 500 erorr, and I cannot
In this snippet: class ClassWithConstants { private const string ConstantA = Something; private const
This snippet basically reads a file line by line, which looks something like: Album=In
This snippet of code always parses the date into the current timezone, and not
This snippet throws an NullPointerException due to the fact that its unboxed to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.