Currently only available on svn version with mono 2.6.x
MonoDevelop Database Addin implements SqlMetal integration. The responsive addin for this integration is MonoDevelop.Database.CodeGenerator:

This addin insert 2 Tools menu at:


Clicking on any of the above detailed menus you'll see a dialog like the following:

In this dialog you will have to select the Database Connection.
This connection could be added in this dialog by clicking New or you can Edit the selected connection.
The output options are the generated output (Code or Dbml file), target language, case style,anfilename.
The target project has to be selected and if it is needed the folder of the target project to. The namespace is the class namespace of the generated file.
After filling all the required information, you must press OK and the file will be generated and added to the project.
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| AddinManager.png No description | 76.77 kB | 01:43, 16 Feb 2010 | lucian0c? | Actions | ||
| Generate Linq Class.png No description | 44.51 kB | 02:10, 16 Feb 2010 | lucian0c? | Actions | ||
| Project Tools Menu.png No description | 36.62 kB | 02:06, 16 Feb 2010 | lucian0c? | Actions | ||
| Tools Menu.png No description | 83.55 kB | 01:59, 16 Feb 2010 | lucian0c? | Actions | ||
I verified the connection to my mySql database by executing a query against one of the tables in it through the MonoDevelop interface. I chose the same connection for generating the Linq class.
It wasn't clear to me from your post if I'm supposed to enter information for Entity Base, Entity Attributes, Member Attributes, or Generate Type, so I left those blank.
Is this a bug or am I doing something wrong?
MonoDevelop.Database.Sql.SqlMetalExecException: sqlmetal failed:ByteFX.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?db' at line 3
at ByteFX.Data.MySqlClient.Driver.ReadPacket () [0x00000] in <filename unknown>:0
at ByteFX.Data.MySqlClient.Driver.Send (DBCmd cmd, System.Byte[] bytes) [0x00000] in <filename unknown>:0
at ByteFX.Data.MySqlClient.MySqlCommand.ExecuteBatch (Boolean stopAtResultSet) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) ByteFX.Data.MySqlClient.MySqlCommand:ExecuteBatch (bool)
at ByteFX.Data.MySqlClient.MySqlDataReader.NextResult () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) ByteFX.Data.MySqlClient.MySqlDataReader:NextResult ()
at ByteFX.Data.MySqlClient.MySqlCommand.ExecuteReader (CommandBehavior behavior) [0x00000] in <filename unknown>:0
at ByteFX.Data.MySqlClient.MySqlCommand.ExecuteReader () [0x00000] in <filename unknown>:0
at ByteFX.Data.MySqlClient.MySqlCommand.System.Data.IDbCommand.ExecuteReader () [0x00000] in <filename unknown>:0
at DbLinq.Util.DataCommand.Find[IDataName] (IDbConnection conn, System.String sql, System.String dbParameterName, System.String db, System.Func`2 readDelegate) [0x00000] in <filename unknown>:0
at DbLinq.MySql.MySqlSchemaLoader.ReadTables (IDbConnection connectionString, System.String databaseName) [0x00000] in <filename unknown>:0
at DbLinq.Vendor.Implementation.SchemaLoader.LoadTables (DbLinq.Schema.Dbml.Database schema, DbLinq.Schema.SchemaName schemaName, IDbConnection conn, INameAliases nameAliases, DbLinq.Schema.NameFormat nameFormat, DbLinq.Vendor.Implementation.Names names) [0x00000] in <filename unknown>:0
at DbLinq.Vendor.Implementation.SchemaLoader.Load (System.String databaseName, INameAliases nameAliases, DbLinq.Schema.NameFormat nameFormat, Boolean loadStoredProcedures, System.String contextNamespace, System.String entityNamespace) [0x00000] in <filename unknown>:0
at DbMetal.Generator.Implementation.Processor.ReadSchema (DbMetal.Parameters parameters, ISchemaLoader& schemaLoader) [0x00000] in <filename unknown>:0
at DbMetal.Generator.Implementation.Processor.ProcessSchema (DbMetal.Parameters parameters) [0x00000] in <filename unknown>:0
I was wondering how to generate the Model in a MonoDevelop MVC project and I figured "Linq to Sql" would provide some useful code. Sadly on my Ubuntu 10.10 (yup alpha) I get an error: "MonoDevelop.Database.Sql.SqlMetalExecException: sqlmetal: Object reference not set to an instance of an object". I wonder if this is because I just selected the Connection and left Base, Attributes, Member & Type empty.
I know the previous comment was posted 18:11. 27 Jun 2010 and it's probably unwise of me to hope for an answer, but; I've always been a little crazy.
Version: monodevelop 2.4+dfsg-1ubuntu1 Development Environment for GNOME
MonoDevelop.Database.Sql.SqlMetalExecException: sqlmetal: Could not find file "/entityBase:rick"?
email me ?1989wangbojing@163.com !