Since the Codesmith connection to MySQL DLL is a bit small bug, unable to get the table and column description information, so, need to re-modify the driver.
As shown, the Codesmith MySQL driver is unable to get a description of the tables and columns. So we need to re-modify Mysqlschemaprovide. The steps are as follows:
- Follow the path to open the project.
- Note that you need to reintroduce the DLL.
- Open the MySQL client program and view the table structure and column structure first.
- Open the project, modify the code, the key code is as follows:
- Above is the addition of the table description column, the method below is a description of the table, the original content is:
if (Schemaobject is Tableschema) {Tableschema Tableschema = schemaobject as Tableschema; String CommandText = String. Format (@ "SHOW CREATE TABLE ' {0} '. ' {1} '", TableSchema.Database.Name, Tableschema.name); using (DbConnection connection = CreateConnection (connectionString)) {connection. Open (); DbCommand Command = connection. CreateCommand (); Command.commandtext = CommandText; Command. Connection = Connection; using (IDataReader reader = command. ExecuteReader (CommandBehavior.CloseConnection)) {while (reader. Read ()) {string createtable = reader. GetString (1); Extendedproperties.add (New Extendedproperty ("Cs_createtablescript", CreateTable, dbtype.string)); } if (!rEader. IsClosed) reader. Close (); } if (connection. state! = connectionstate.closed) connection. Close (); } }
- Modify the above SQL statement to select Table_name,table_comment from Information_schema. ' TABLES ' where table_schema= ' {0} ' and table_name= ' {1} '. and will Extendedproperties.add (new Extendedproperty ("Cs_createtablescript", CreateTable, dbtype.string)); Extendedproperties.add (New Extendedproperty ("Cs_description", CreateTable, dbtype.string));
- After recompiling, replace the compiled DLL component with the DLL inside the CODESMITH7. Path
- Eventually
If you need to complete the DLL, you can leave the email address. Take the time to send the completed DLL to everyone.
CodeSmith7 connecting MySQL