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

  • Home
  • SEARCH
  • 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 7444265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:28:30+00:00 2026-05-29T11:28:30+00:00

My coworker wrote a package in VB.NET to manipulate strings. I have been asked

  • 0

My coworker wrote a package in VB.NET to manipulate strings. I have been asked to implement them through CLR. The package accesses a reference database on the same server as the CLR dll file deployed to standardize the strings. I imported the package to my CLR code to create the functions for SQL Server.

After I deploy the dll file to sql server, the functions work fine except occasionally I get the error

System.NullReferenceException: Object reference not set to an instance of an object.

I have to execute my query several times to make it work. It seems the table is locked or sleeping. My query is like

SELECT EMAIL_ADDRESS, dbo.ufn_getEmailDomain(Email_Address) AS EDOMAIN FROM CONTACT_TEMP
WHERE Email_Address IS NOT NULL AND Email_Address<>”

dbo.ufn_getEmailDomain is the CLR function.

There is no online access to this server at all. I searched for a while and couldn’t find why this error comes up occasionally or how to fix it.

Your feedback is greatly appreciated.

my CLR functions here.

<Microsoft.SqlServer.Server.SqlFunction(DataAccess:=DataAccessKind.Read)> _
Public Shared Function ufn_getEmailDomainSLD(ByVal email As String) As String

    If email Is Nothing Then
        Return Nothing
    End If

    Dim de As New DataEmail(email)
    Dim dm As New DataDomain
    Dim emailDomain As String
    dm = de.Domain

    emailDomain = dm.SLD

    Return emailDomain
End Function
  • 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-05-29T11:28:31+00:00Added an answer on May 29, 2026 at 11:28 am

    I found the reason eventually. In the connection string in the CLR code, I should set ENLIST=FALSE because it connects to a different database. Once I set ENLIST=FALSE, the problem seems to be fixed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of my coworkers wrote a .NET windows service that converts .doc to .docx
A coworker showed me the following code and asked me why it worked. <span
An ex-coworker of mine wrote the following UPDATE as part of a data import
A coworker asked me today how to add a range to a collection. He
A coworker recently wrote a program in which he used a Python list as
A coworker asked me to look at indexing on some tables because his query
I am using windows 7 running .net 4.0 I wrote an application on my
Repost from Perlmonks for a coworker: I wrote a perl script to separate long
My Google-fu is failing me on this question. I have a coworker who has
I recently wrote a DLL in C# (.Net 2.0) which contains a class that

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.