This is a migrated thread and some comments may be shown as answers.

Problem with Getting Started for OpenAccess

1 Answer 49 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marion
Top achievements
Rank 1
Marion asked on 13 Aug 2010, 05:00 PM
In going through the Quickstart here http://www.telerik.com/help/openaccess-orm/getting-started-root-quickstart-winforms-overview.html
 I get the following error when compiling/running the application. I've started from scratch about 4 times using different machines, figuring I was mistyping something. Anything I should be looking for to solve this? I also tried the ASP.NET version of this Quickstart for kicks but I got my share of errors there too.

Error 2 The type or namespace name 'SofiaCarRentalDbContext' could not be found (are you missing a using directive or an assembly reference?) c:\users\mariond\documents\visual studio 2010\Projects\TelerikOrm\WindowsFormsOpenAccessIntegration\WindowsFormsOpenAccessIntegration\Form1.cs 14 17 WindowsFormsOpenAccessIntegration

Below is my code for form1.cs and and I've attached a screenshot of my project references.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsOpenAccessIntegration
{
    public partial class Form1 : Form
    {
        private SofiaCarRentalDbContext dbContext = new SofiaCarRentalDbContext();
        private BindingSource dataSource = new BindingSource();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btnLoadCars_Click(object sender, EventArgs e)
        {
            this.dataSource.DataSource = dbContext.Cars.Where(c => c.Make == tbMake.Text).ToList();
            this.dgvCars.DataSource = this.dataSource;
        }
    }
}



thanks,
marion

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 17 Aug 2010, 12:56 PM
Hello Marion,

The data context from the getting started tutorial is named SofiaCarRentalDbContext. It seems that you provided different Model name on step #6 from the “Creating Domain Model” article. This Model name value is used as a name of the generated data context class. 
To query data you should use an instance of the class generated under the SofiaCarRentalDomainModel.cs file.
Hope that helps. It that is not the case, please provide us with your project where the problem is reproduced. For that purpose you should open a support thread as it is not possible to attach projects in forum posts.


Greetings,
Damyan Bogoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Getting Started
Asked by
Marion
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or