MappingSource could not be found (DBLinq)

M

Matthijs de Z

Hi,

(I also posted this question on http://groups.google.com/group/dblinq,
but that forum is less active)

In mysql I created a DB called 'dblinqtest' with a table 'table1'
created with the following structure (it was just for a test):


CREATE TABLE `table1` (
`name` varchar(30) COLLATE latin1_general_ci NOT
NULL,
`city` varchar(30) COLLATE latin1_general_ci NOT
NULL,
`phonenumber` varchar(30) COLLATE latin1_general_ci NOT
NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
COLLATE=latin1_general_ci


I used dbmetal 0.19.0.0 with this batch to create a c# class:


DbMetal.exe --provider=MySql --database:dblinqtest --server=127.0.0.1
--user=root --password:1matthijs2 --namespace=dblinqtestNS --
code=dblinqclass.cs --sprocs


after that, I created a new c# program added DbLinq, DbLinq.MySql and
MySql.Data to the references and added dblinqclass.cs to the project.


The main form is just empty and I tried to compile.
Unfortunately I got some errors.


"Error 1 The type or namespace name 'MappingSource' could
not be found
(are you missing a using directive or an assembly reference?) C:
\Documents and Settings\matthijs\My Documents\Visual Studio
2008\Projects\dblinq tests\projects
\dblinqtest1\dblinqtest1\dblinqclass.cs 52 40 dblinqtest1
"


and


"Error 3 The type or namespace name 'IVendor' could not be
found (are
you missing a using directive or an assembly reference?) C:
\Documents
and Settings\matthijs\My Documents\Visual Studio 2008\Projects\dblinq
tests\projects\dblinqtest1\dblinqtest1\dblinqclass.cs 65 47
dblinqtest1
"


"Error 7 The type or namespace name 'TableAttribute' could
not be
found (are you missing a using directive or an assembly
reference?) C:
\Documents and Settings\matthijs\My Documents\Visual Studio
2008\Projects\dblinq tests\projects
\dblinqtest1\dblinqtest1\dblinqclass.cs 84 3 dblinqtest1
"


"Error 8 The type or namespace name 'Column' could not be
found (are
you missing a using directive or an assembly reference?) C:
\Documents
and Settings\matthijs\My Documents\Visual Studio 2008\Projects\dblinq
tests\projects\dblinqtest1\dblinqtest1\dblinqclass.cs 132 4
dblinqtest1
"


"Error 9 The type or namespace name 'ColumnAttribute' could
not be
found (are you missing a using directive or an assembly
reference?) C:
\Documents and Settings\matthijs\My Documents\Visual Studio
2008\Projects\dblinq tests\projects
\dblinqtest1\dblinqtest1\dblinqclass.cs 132 4 dblinqtest1
"


etc...etc...


Am I missing a reference? Or do I need to do something else. I
googled
around and cannot find what the problem is. Maybe you know?


Kind regards,


Matthijs


the class file created by dbmetal
-----------------------------------------------
#region Auto-generated classes for dblinqtest database on 2010-01-27
10:20:07Z


//
// ____ _ __ __ _ _
// | _ \| |__ | \/ | ___| |_ __ _| |
// | | | | '_ \| |\/| |/ _ \ __/ _` | |
// | |_| | |_) | | | | __/ || (_| | |
// |____/|_.__/|_| |_|\___|\__\__,_|_|
//
// Auto-generated from dblinqtest on 2010-01-27 10:20:07Z
// Please visit http://linq.to/db for more information


#endregion


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using DbLinq.Data.Linq;
using DbLinq.Data.Linq.Mapping;


namespace dblinqtestNS
{
public partial class DbLinqTest : DataContext
{
#region Extensibility Method Definitions


partial void OnCreated();


#endregion


public DbLinqTest(string connectionString)
: base(connectionString)
{
OnCreated();
}


public DbLinqTest(IDbConnection connection)
#if MONO_STRICT
: base(connection)
#else // MONO_STRICT
: base(connection, new DbLinq.MySql.MySqlVendor
())
#endif // MONO_STRICT
{
OnCreated();
}


public DbLinqTest(string connection, MappingSource
mappingSource)
: base(connection, mappingSource)
{
OnCreated();
}


public DbLinqTest(IDbConnection connection,
MappingSource
mappingSource)
: base(connection, mappingSource)
{
OnCreated();
}


#if !MONO_STRICT
public DbLinqTest(IDbConnection connection, IVendor
vendor)
: base(connection, vendor)
{
OnCreated();
}
#endif // !MONO_STRICT


#if !MONO_STRICT
public DbLinqTest(IDbConnection connection,
MappingSource
mappingSource, IVendor vendor)
: base(connection, mappingSource, vendor)
{
OnCreated();
}
#endif // !MONO_STRICT


public Table<Table1> Table1 { get { return
GetTable<Table1>(); } }


}


[Table(Name = "dblinqtest.table1")]
public partial class Table1 : INotifyPropertyChanging,
INotifyPropertyChanged
{
#region INotifyPropertyChanging handling


public event PropertyChangingEventHandler
PropertyChanging;


private static PropertyChangingEventArgs
emptyChangingEventArgs =
new PropertyChangingEventArgs("");
protected virtual void SendPropertyChanging()
{
if (PropertyChanging != null)
{
PropertyChanging(this,
emptyChangingEventArgs);
}
}


#endregion


#region INotifyPropertyChanged handling


public event PropertyChangedEventHandler
PropertyChanged;


protected virtual void SendPropertyChanged(string
propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new
PropertyChangedEventArgs(propertyName));
}
}


#endregion


#region Extensibility Method Definitions


partial void OnCreated();
partial void OnCityChanged();
partial void OnCityChanging(string value);
partial void OnNameChanged();
partial void OnNameChanging(string value);
partial void OnPhoneNumberChanged();
partial void OnPhoneNumberChanging(string value);


#endregion


#region string City


private string _city;
[DebuggerNonUserCode]
[Column(Storage = "_city", Name = "city", DbType =
"varchar(30)",
AutoSync = AutoSync.Never, CanBeNull = false)]
public string City
{
get
{
return _city;
}
set
{
if (value != _city)
{
OnCityChanging(value);
SendPropertyChanging();
_city = value;
SendPropertyChanged("City");
OnCityChanged();
}
}
}


#endregion


#region string Name


private string _name;
[DebuggerNonUserCode]
[Column(Storage = "_name", Name = "name", DbType =
"varchar(30)",
AutoSync = AutoSync.Never, CanBeNull = false)]
public string Name
{
get
{
return _name;
}
set
{
if (value != _name)
{
OnNameChanging(value);
SendPropertyChanging();
_name = value;
SendPropertyChanged("Name");
OnNameChanged();
}
}
}


#endregion


#region string PhoneNumber


private string _phoneNumber;
[DebuggerNonUserCode]
[Column(Storage = "_phoneNumber", Name =
"phonenumber", DbType =
"varchar(30)", AutoSync = AutoSync.Never, CanBeNull = false)]
public string PhoneNumber
{
get
{
return _phoneNumber;
}
set
{
if (value != _phoneNumber)
{
OnPhoneNumberChanging(value);
SendPropertyChanging();
_phoneNumber = value;
SendPropertyChanged
("PhoneNumber");
OnPhoneNumberChanged();
}
}
}


#endregion


#region ctor


public Table1()
{
OnCreated();
}


#endregion


}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top