BC30554: 'xxxxDBDataContext' is ambiguous

1.5k Views Asked by At

I'm working on a VB.net project in VS 2012 and I'm getting the below error message.

Error Details C:\xxx\xxxApp\xxxApplication.aspx(51): error BC30554: 'xxxxDBDataContext' is ambiguous.

Error Source System.Web

Here is the screenshot of the source code Code behind utility class

1

There are 1 best solutions below

0
On

The error "'<ClassName>' is ambiguous" is usually given when the compiler encounters two identical classes (or a class and a namespace, etc.) that are either in the same namespace, or have both been imported into your environment. So, for example, if you had System.Data.DataTable and MyNamespace.DataTable and had imported both of them into your environment:

Imports System.Data
Imports MyNamespace

If after this you just referenced:

Dim dt As DataTable

Then the compiler will tell you 'DataTable' is ambiguous because it doesn't know which one you're referring to. You need to qualify the name with either:

Dim dt As System.Data.DataTable

or

Dim dt As MyNameSpace.DataTable