а

ASP.NET WebForms Models


#1

i followed the ASP.NET WebForms tutorial but it still shows me this message and i don’t know what to do with it

|Error|CS0234|The type or namespace name ‘Models’ does not exist in the namespace ‘SchedulerNetAsp’ (are you missing an assembly reference?)

if anyone could help that would be great


#2

Hi,
Can you please give me a link to a tutorial you referring to?
Do you use dhtmlxScheduler for ASP.NET (http://scheduler-net.com) or the javascript scheduler (https://docs.dhtmlx.com/scheduler/howtostart_guides.html
)?

Most likely it’s down to the definition of your model classes. The code of your page assumes they are declared under SchedulerNetAsp.Models namespace and there is using SchedulerNetAsp.Models; command somewhere.

This namespace appears not to be declared in your app hence the error. You’ll need to check the definitions of model classes to see in which namespace they are actually declared.
They may be declared in the common project namespaces (SchedulerNetAsp), so the error may be fixed by simply removing using SchedulerNetAsp.Models; from your code.

If nothing helps - please share some code or a complete sample project where the error can be reproduced


#3

here is the project i made with the tutorial: https://drive.google.com/file/d/135g0U2X9Q7TVfdy5nonjMjcu3aZpuXjE/view?usp=sharing

the only thing i did differently is using my own database and tables.

i followed this tutorial: http://scheduler-net.com/docs/common-application-with-scheduler.html


#4

Hello,

I apologize for such a late response.

I’ve checked the project and looks like you have two dbml files there:
One is located in the project root directory and another is in Models directory:

The one from the Models folder doesn’t seem to be included in the project and I believe it’s not compiled because of that.

So I think you need to

  1. Delete Scheduler.dbml and related files (Scheduler.dbml.layout, Scheduler.designer.cs) located on the project root http://prntscr.com/ps6e1p
  2. Included files from the Model folder into the project http://prntscr.com/ps6d3s

Once I’ve done this and ran the project (be sure you have “LINQ to SQL tools” for your Visual Studio installed, it can be found in VS Installer under the “Code Tools”), everything is compiled correctly.

Also please note, web.config and dbml files on your google drive contain database connection credentials that look realistic - please be sure it’s not something that can be used to gain access to your database