Problem with Getting Started for OpenAccess

2 posts, 0 answers
  1. Marion
    Marion avatar
    5 posts
    Member since:
    Nov 2007

    Posted 13 Aug 2010 Link to this post

    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
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 17 Aug 2010 Link to this post

    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
  3. DevCraft banner
Back to Top