This question is locked. New answers and comments are not allowed.
I am hoping someone can help me. I have only really created websites using the traditional website method (not a project). I created a model, but I don't think I am referencing the model correctly in my website.
This is what I have done.
I right-clicked on my website (in the solution explorer) and selected "Add Reference.."
I browsed to my model (CAFModel) and navigated to the Model ->Bin->Release folder and selected both the
CAFModel.dll and the Telerik.OpenAccess.35.Extensions.dll
On the asp.net webform where I want to use the model, I added:
This didn't seem to do the trick, however.
I get the following error when I try the below test code:
Code:
Error:
Error 103 'CAFModel.EntitiesModel': type used in a using statement must be implicitly convertible to 'System.IDisposable'
Error 102 'CAFModel.EntitiesModel' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'CAFModel.EntitiesModel' could be found (are you missing a using directive or an assembly reference?) D:\Documents and Settings\Robert\My Documents\My Dropbox\My Web Sites\sbcaf\test\default.aspx.cs 29 22 D:\...\sbcaf\
Any help would be appreciated.
Thanks,
Rob
This is what I have done.
I right-clicked on my website (in the solution explorer) and selected "Add Reference.."
I browsed to my model (CAFModel) and navigated to the Model ->Bin->Release folder and selected both the
CAFModel.dll and the Telerik.OpenAccess.35.Extensions.dll
On the asp.net webform where I want to use the model, I added:
using
CAFModel;
This didn't seem to do the trick, however.
I get the following error when I try the below test code:
Code:
using
(EntitiesModel CAFModel =
new
EntitiesModel())
{
Member member1 =
new
Member();
member1.FirstName =
"first name"
;
CAFModel.Add(member1);
}
Error:
Error 103 'CAFModel.EntitiesModel': type used in a using statement must be implicitly convertible to 'System.IDisposable'
Error 102 'CAFModel.EntitiesModel' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'CAFModel.EntitiesModel' could be found (are you missing a using directive or an assembly reference?) D:\Documents and Settings\Robert\My Documents\My Dropbox\My Web Sites\sbcaf\test\default.aspx.cs 29 22 D:\...\sbcaf\
Any help would be appreciated.
Thanks,
Rob