I am getting the following error
Error 36 'SLICDataContext' is an ambiguous reference between 'SLIC_DataAccess.SLICDataContext' and 'SLIC_DataAccess.Generic.SLICDataContext' CreateRequest.aspx.cs 48 36 C:...
Code:
int num = (
from x in (new SLICDataContext()).ClientsToPriorities
where x.PriorityID == Convert.ToInt32(this.drpPriority.SelectedValue)
where x.ClientID == this.GetClientID
select x.ClientToPriorityID).Single<int>();
return num;
Namespaces I am using
using SLIC_DataAccess.Generic;
using SLIC_DataAccess;
How can I be more specific in referencing the namespaces in my code to resolve this?
You need to fully qualify your class in your code using the applicable namespace.
Depending on the implementation, it will be one of these:
from x in (new SLIC_DataAccess.Generic.SLICDataContext()).ClientsToPriorities
or
from x in (new SLIC_DataAccess.SLICDataContext()).ClientsToPriorities
Another option would be to use aliases as follows:
using SLIC_DA_Generics = SLIC_DataAccess.Generic;
using SLIC_DA = SLIC_DataAccess;
with the appropriate usage as follows:
from x in (new SLIC_DA_Generics.SLICDataContext()).ClientsToPriorities
or
from x in (new SLIC_DA.SLICDataContext()).ClientsToPriorities
You can explicitly say which namespace you wish to use, for example:
from x in (new SLIC_DataAccess.Generic.SLICDataContext()).ClientsToPriorities
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With