On the relevant line of code, it's accessing the variables `fieldType` and
`field`. `field` is constructed via `new`, and thus can't be null, so I'd bet
that `fieldType` is null:
var fieldType = TypeLoader.Load(column.Type);
which doesn't help much, as we don't know what type it's trying to load.
Thus, side step the issue: this is happening during C# generation, so instead,
generate .dbml:
dbmetal.exe /provider:MySQL /server:192.168.0.7 /database:in_out
/user:sid /password:eziome /dml:foo.dbml
(BTW, you should probably change your password and scrub your emails in the
future.)
Then, inspect the foo.dbml file, looking at the //Column/@Type attribute
values, and see if they make sense.
My guess is that there's either a case sensitivity problem or there's something
screwing with the DB column types that DbMetal is reading, and it's storing an
empty string in some //Column/@Type attribute value.
- Jon
On Jan 10, 2011, at 3:53 PM, Sid Price wrote:
> Sorry for the overload of information; Here is the debug dump:
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dbmetal.exe --provider=Mysql
> --server=192.168.0.7 --
> database=in_out --user=sid --password=eziome --code=files\dblinq_mysql.vb
> --debug
> DbLinq Database mapping generator 2008 version 0.20
> for Microsoft (R) .NET Framework version 3.5
> Distributed under the MIT licence (http://linq.to/db/license)
>
>>>> Reading schema from MySQL database
> <<< writing C# classes in file 'files\dblinq_mysql.vb'
> DbMetal: System.NullReferenceException: Object reference not set to an
> instance
> of an object.
> at DbMetal.Generator.CodeDomGenerator.GenerateTableClass(Table table,
> Database database) in
> :\Development\DbLinq-0.20.1\src\DbMetal\Generator\CodeDomGenerator.cs:line
> 763
> at DbMetal.Generator.CodeDomGenerator.GenerateCodeDomModel(Database
> database) in
> z:\Development\DbLinq-.20.1\src\DbMetal\Generator\CodeDomGenerator.cs:line
> 175
> at DbMetal.Generator.CodeDomGenerator.Write(TextWriter textWriter,
> Database dbSchema, GenerationContext context) in
> z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\CodeDomGenerator.cs:line
> 85
> at DbMetal.Generator.Implementation.Processor.GenerateCode(Parameters
> parameters, Database dbSchema, ISchemaLoader schemaLoader, String filename)
> in
> z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\Implementation\Processor.
> cs:line 234
> at DbMetal.Generator.Implementation.Processor.WriteSchema(Database
> dbSchema,ISchemaLoader schemaLoader, Parameters parameters) in
> z:\Development\DbLinq-0.20
> .1\src\DbMetal\Generator\Implementation\Processor.cs:line 178
> at DbMetal.Generator.Implementation.Processor.ProcessSchema(Parameters
> parameters) in
> z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\Implementation\Processor.
> cs:line 116
>
> Sid.
>
> Avian Ambassadors - Flights of Education
> www.AvianAmbassadors.com
> The Bird Training Blog
> Behavior and Training Seminars
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of
> Sid Price
> Sent: Monday, January 10, 2011 1:05 PM
> To: [email protected]
> Subject: RE: [dblinq] Novice needs help
>
> 01/08/2011 06:41 PM <DIR> Microsoft.SqlServer.SQLTask
> 12/11/2010 04:33 PM <DIR>
> Microsoft.TeamFoundation.WorkItemTracking
> .Client.Cache
> 12/11/2010 04:33 PM <DIR>
> Microsoft.TeamFoundation.WorkItemTracking
> .Client.DataStore
> 12/11/2010 04:33 PM <DIR>
> Microsoft.TeamFoundation.WorkItemTracking
> .Client.RuleEngine
> 07/13/2009 09:52 PM <DIR> Microsoft.Transactions.Bridge.Dtc
> 12/10/2010 12:08 PM <DIR> Microsoft.VisualC.VSCodeParser
> 12/10/2010 12:08 PM <DIR>
> Microsoft.VisualStudio.Modeling.Diagrams.
> GraphObject
> 01/08/2011 06:14 PM <DIR>
> Microsoft.VisualStudio.Modeling.Sdk.Diagr
> ams.GraphObject
> 07/13/2009 09:52 PM <DIR> Microsoft.Windows.Diagnosis.SDEngine
> 12/27/2010 12:59 PM <DIR>
> Microsoft.Xna.GameStudio.PlatformTools
> 07/13/2009 09:52 PM <DIR> MSBuild
> 01/08/2011 06:14 PM <DIR> mscorcfg
> 07/13/2009 07:37 PM <DIR> mscorlib
> 07/13/2009 07:37 PM <DIR> napcrypt
> 07/13/2009 07:37 PM <DIR> naphlpr
> 07/13/2009 09:52 PM <DIR> Policy.1.0.Microsoft.Ink
> 07/13/2009 07:37 PM <DIR>
> Policy.1.0.Microsoft.Interop.Security.AzR
> oles
> 07/13/2009 07:37 PM <DIR>
> Policy.1.2.Microsoft.Interop.Security.AzR
> oles
> 07/13/2009 09:52 PM <DIR> Policy.1.7.Microsoft.Ink
> 07/13/2009 09:52 PM <DIR> Policy.6.0.Microsoft.Ink
> 07/13/2009 09:52 PM <DIR> PresentationCore
> 12/11/2010 09:30 AM <DIR> soapsudscode
> 07/13/2009 07:37 PM <DIR> System.Data
> 07/13/2009 07:37 PM <DIR> System.Data.OracleClient
> 07/13/2009 07:37 PM <DIR> System.EnterpriseServices
> 07/13/2009 09:52 PM <DIR> System.Printing
> 07/13/2009 07:37 PM <DIR> System.Transactions
> 07/13/2009 07:37 PM <DIR> System.Web
> 12/14/2010 05:30 PM <DIR> vjscor
> 12/14/2010 05:30 PM <DIR> VJSharpCodeProvider
> 12/14/2010 05:30 PM <DIR> vjsjbc
> 12/14/2010 05:30 PM <DIR> vjslib
> 12/14/2010 05:30 PM <DIR> vjslibcw
> 12/14/2010 05:30 PM <DIR> VJSSupUILib
> 12/14/2010 05:30 PM <DIR> vjsvwaux
> 12/14/2010 05:30 PM <DIR> vjswfc
> 12/14/2010 05:30 PM <DIR> VjsWfcBrowserStubLib
> 12/14/2010 05:30 PM <DIR> vjswfccw
> 12/14/2010 05:30 PM <DIR> vjswfchtml
> 12/11/2010 09:27 AM <DIR> WebDev.WebHost
> 12/11/2010 05:00 PM <DIR> WebDev.WebHost20
> 0 File(s) 0 bytes
> 80 Dir(s) 14,358,151,168 bytes free
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dir \windows\assembly\gac_32\my*
> Volume in drive C has no label.
> Volume Serial Number is B0AA-F075
>
> Directory of C:\windows\assembly\gac_32
>
> File Not Found
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dir \windows\assembly\gac_32\m*.*
> Volume in drive C has no label.
> Volume Serial Number is B0AA-F075
>
> Directory of C:\windows\assembly\gac_32
>
> 07/14/2009 12:51 AM <DIR> mcstoredb
> 07/14/2009 12:51 AM <DIR> mcupdate
> 07/14/2009 12:51 AM <DIR> Mcx2Dvcs
> 07/13/2009 09:52 PM <DIR>
> Microsoft-Windows-HomeGroupDiagnostic.Net
> ListMgr.Interop
> 12/14/2010 05:30 PM <DIR> Microsoft.Build.VisualJSharp
> 12/11/2010 12:00 PM <DIR> Microsoft.Expression.Encoder
> 12/11/2010 12:00 PM <DIR> Microsoft.Expression.Encoder.Api2
> 12/11/2010 12:00 PM <DIR>
> Microsoft.Expression.Encoder.resources
> 12/11/2010 12:00 PM <DIR> Microsoft.Expression.Encoder.Types
> 12/11/2010 12:00 PM <DIR>
> Microsoft.Expression.Encoder.Utilities
> 12/11/2010 11:53 AM <DIR>
> Microsoft.Expression.Web.Interop.Protocol
> sInternal
> 07/14/2009 12:51 AM <DIR> Microsoft.GroupPolicy.AdmTmplEditor
> 07/14/2009 12:51 AM <DIR>
> Microsoft.GroupPolicy.AdmTmplEditor.Resou
> rces
> 07/14/2009 12:51 AM <DIR> Microsoft.GroupPolicy.Interop
> 07/13/2009 09:52 PM <DIR> Microsoft.Ink
> 07/13/2009 07:37 PM <DIR> Microsoft.Interop.Security.AzRoles
> 07/14/2009 12:51 AM <DIR> Microsoft.MediaCenter.Interop
> 07/14/2009 12:51 AM <DIR> Microsoft.MediaCenter.iTV.Media
> 07/14/2009 12:51 AM <DIR> Microsoft.MediaCenter.Mheg
> 07/14/2009 12:51 AM <DIR> Microsoft.MediaCenter.Playback
> 07/14/2009 12:51 AM <DIR>
> Microsoft.MediaCenter.TV.Tuners.Interop
> 07/14/2009 12:51 AM <DIR>
> Microsoft.Security.ApplicationId.PolicyMa
> nagement.PolicyEngineApi.Interop
> 01/08/2011 06:42 PM <DIR>
> Microsoft.SqlServer.ActiveXScriptTaskUtil
>
> 01/08/2011 06:41 PM <DIR> Microsoft.SqlServer.BatchParser
> 01/08/2011 06:42 PM <DIR>
> Microsoft.SqlServer.BulkInsertTaskConnect
> ions
> 01/08/2011 06:41 PM <DIR> Microsoft.SqlServer.DTSRuntimeWrap
> 01/08/2011 06:05 PM <DIR> Microsoft.SqlServer.GridControl
> 01/08/2011 06:09 PM <DIR> Microsoft.SqlServer.MgdSqlDumper
> 01/08/2011 06:41 PM <DIR> Microsoft.SqlServer.Replication
> 01/08/2011 06:41 PM <DIR> Microsoft.SqlServer.SQLTask
> 12/11/2010 04:33 PM <DIR>
> Microsoft.TeamFoundation.WorkItemTracking
> .Client.Cache
> 12/11/2010 04:33 PM <DIR>
> Microsoft.TeamFoundation.WorkItemTracking
> .Client.DataStore
> 12/11/2010 04:33 PM <DIR>
> Microsoft.TeamFoundation.WorkItemTracking
> .Client.RuleEngine
> 07/13/2009 09:52 PM <DIR> Microsoft.Transactions.Bridge.Dtc
> 12/10/2010 12:08 PM <DIR> Microsoft.VisualC.VSCodeParser
> 12/10/2010 12:08 PM <DIR>
> Microsoft.VisualStudio.Modeling.Diagrams.
> GraphObject
> 01/08/2011 06:14 PM <DIR>
> Microsoft.VisualStudio.Modeling.Sdk.Diagr
> ams.GraphObject
> 07/13/2009 09:52 PM <DIR> Microsoft.Windows.Diagnosis.SDEngine
> 12/27/2010 12:59 PM <DIR>
> Microsoft.Xna.GameStudio.PlatformTools
> 07/13/2009 09:52 PM <DIR> MSBuild
> 01/08/2011 06:14 PM <DIR> mscorcfg
> 07/13/2009 07:37 PM <DIR> mscorlib
> 0 File(s) 0 bytes
> 42 Dir(s) 14,358,151,168 bytes free
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dir \windows\assembly\gac
> Volume in drive C has no label.
> Volume Serial Number is B0AA-F075
>
> Directory of C:\windows\assembly\gac
>
> 01/08/2011 06:44 PM <DIR> .
> 01/08/2011 06:44 PM <DIR> ..
> 12/10/2010 12:08 PM <DIR> ADODB
> 12/10/2010 12:16 PM <DIR>
> CrystalDecisions.Enterprise.Desktop.Repor
> t
> 12/10/2010 12:16 PM <DIR> CrystalDecisions.Enterprise.Framework
> 12/10/2010 12:16 PM <DIR> CrystalDecisions.Enterprise.InfoStore
> 12/10/2010 12:16 PM <DIR>
> CrystalDecisions.Enterprise.PluginManager
>
> 12/10/2010 12:16 PM <DIR>
> CrystalDecisions.Enterprise.Viewing.Repor
> tSource
> 01/08/2011 06:44 PM <DIR> EnvDTE
> 01/08/2011 06:44 PM <DIR> EnvDTE80
> 01/08/2011 06:14 PM <DIR> EnvDTE90
> 01/08/2011 06:14 PM <DIR> EnvDTE90a
> 12/10/2010 12:08 PM <DIR> Extensibility
> 07/13/2009 09:42 PM <DIR> Microsoft.Ink
> 01/08/2011 06:14 PM <DIR>
> Microsoft.Internal.VisualStudio.Shell.Int
> erop.9.0
> 12/10/2010 12:08 PM <DIR> Microsoft.mshtml
> 01/08/2011 06:10 PM <DIR> Microsoft.Office.Interop.Owc11
> 12/10/2010 12:08 PM <DIR> Microsoft.StdFormat
> 01/08/2011 06:10 PM <DIR> Microsoft.Vbe.Interop
> 12/10/2010 12:08 PM <DIR> Microsoft.VisualStudio.CommandBars
> 01/08/2011 06:44 PM <DIR>
> Microsoft.VisualStudio.Debugger.Interop
> 12/10/2010 11:54 AM <DIR>
> Microsoft.VisualStudio.Debugger.InteropA
> 12/10/2010 12:08 PM <DIR>
> Microsoft.VisualStudio.Designer.Interface
> s
> 12/10/2010 11:54 AM <DIR> Microsoft.VisualStudio.OLE.Interop
> 12/11/2010 09:27 AM <DIR> Microsoft.VisualStudio.Shell.Interop
> 01/08/2011 06:44 PM <DIR>
> Microsoft.VisualStudio.Shell.Interop.8.0
> 01/08/2011 06:14 PM <DIR>
> Microsoft.VisualStudio.Shell.Interop.9.0
> 12/10/2010 11:54 AM <DIR>
> Microsoft.VisualStudio.TextManager.Intero
> p
> 01/08/2011 06:44 PM <DIR>
> Microsoft.VisualStudio.TextManager.Intero
> p.8.0
> 01/08/2011 06:14 PM <DIR>
> Microsoft.VisualStudio.TextManager.Intero
> p.9.0
> 12/11/2010 05:00 PM <DIR> Microsoft.VisualStudio.VCCodeModel
> 12/11/2010 05:00 PM <DIR> Microsoft.VisualStudio.VCProject
> 12/11/2010 05:00 PM <DIR>
> Microsoft.VisualStudio.VCProjectEngine
> 12/10/2010 11:54 AM <DIR> Microsoft.VisualStudio.VSHelp
> 01/08/2011 06:44 PM <DIR> Microsoft.VisualStudio.VSHelp80
> 01/08/2011 06:10 PM <DIR> mscomctl
> 12/10/2010 12:08 PM <DIR> MSDATASRC
> 01/08/2011 06:10 PM <DIR> Policy.11.0.Microsoft.Vbe.Interop
> 12/11/2010 11:39 AM <DIR> stdole
> 12/10/2010 12:08 PM <DIR> VSLangProj
> 12/10/2010 12:08 PM <DIR> VSLangProj2
> 01/08/2011 06:44 PM <DIR> VSLangProj80
> 01/08/2011 06:14 PM <DIR> VslangProj90
> 12/10/2010 12:08 PM <DIR> VsWebSite.Interop
> 12/11/2010 05:00 PM <DIR> VsWebSite.Interop100
> 01/08/2011 06:14 PM <DIR> VsWebSite.Interop90
> 0 File(s) 0 bytes
> 46 Dir(s) 14,358,151,168 bytes free
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>copy \mysql.data.dll .
> 1 file(s) copied.
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dbmetal.exe --provider=Mysql
> --server=192.168.0.7 --
> database=in_out --user=sid --password=eziome --code=files\dblinq_mysql.vb
> DbLinq Database mapping generator 2008 version 0.20
> for Microsoft (R) .NET Framework version 3.5
> Distributed under the MIT licence (http://linq.to/db/license)
>
>>>> Reading schema from MySQL database
> <<< writing C# classes in file 'files\dblinq_mysql.vb'
> DbMetal: Object reference not set to an instance of an object.
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dbmagic
> 'dbmagic' is not recognized as an internal or external command,
> operable program or batch file.
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dbmetal
> DbLinq Database mapping generator 2008 version 0.20
> for Microsoft (R) .NET Framework version 3.5
> Distributed under the MIT licence (http://linq.to/db/license)
>
> DbMetal [OPTIONS] [<DBML INPUT FILE>]
>
> Generates code and mapping for DbLinq. SqlMetal can:
> - Generate source code and mapping attributes or a mapping file from a
> databas
> e.
> - Generate an intermediate dbml file for customization from the database.
> - Generate code and mapping attributes or mapping file from a dbml file.
>
> -c, --conn=CONNECTION STRING
> Database CONNECTION STRING. Cannot be used with
> /server, /user or /password options.
> -u, --user=NAME Login user NAME.
> -p, --password=PASSWORD Login PASSWORD.
> -s, --server=NAME Database server NAME.
> -d, --database=NAME Database catalog NAME on server.
> --provider=PROVIDER Specify PROVIDER. May be Ingres, MySql, Oracle,
> OracleODP, PostgreSql or Sqlite.
> --with-schema-loader=TYPE
> ISchemaLoader implementation TYPE.
> --with-dbconnection=TYPE
> IDbConnection implementation TYPE.
> --with-sql-dialect=TYPE
> IVendor implementation TYPE.
> --code=FILE Output as source code to FILE. Cannot be used
> with /dbml option.
> --dbml=FILE Output as dbml to FILE. Cannot be used with
> /map
> option.
> --language=NAME Language NAME for source code: C#, C#2 or VB
> (default: derived from extension on code file
> name).
> --aliases=FILE Use mapping FILE.
> --schema Generate schema in code files (default:
> enabled).
> --namespace=NAME Namespace NAME of generated code (default: no
> namespace).
> --entitybase=TYPE Base TYPE of entity classes in the generated
> code (default: entities have no base class).
> --member-attribute=ATTRIBUTE
> ATTRIBUTE for entity members in the generated
> code, can be specified multiple times.
> --generate-type=TYPE Generate only the TYPE selected, can be
> specified multiple times and does not prevent
> references from being generated (default:
> generate a DataContex subclass and all the
> entities in the schema).
> --generate-equals-hash Generates overrides for Equals() and
> GetHashCode() methods.
> --sprocs Extract stored procedures.
> --pluralize Automatically pluralize or singularize class
> and
> member names using specified culture rules.
> --culture=CULTURE Specify CULTURE for word recognition and
> pluralization (default: "en").
> --case=STYLE Transform names with the indicated STYLE
> (default: net; may be: leave, pascal, camel,
> net).
> --generate-timestamps Generate timestampes in the generated code
> (default: enabled).
> --readline Wait for a key to be pressed after processing.
> --debug Enables additional information to help with
> debugging, such as full stack traces in error
> messages.
> -h, -?, --help Show this help
>
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>dbmetal.exe --provider=Mysql
> --server=192.168.0.7 --
> database=in_out --user=sid --password=eziome --code=files\dblinq_mysql.vb
> --debu
> g
> DbLinq Database mapping generator 2008 version 0.20
> for Microsoft (R) .NET Framework version 3.5
> Distributed under the MIT licence (http://linq.to/db/license)
>
>>>> Reading schema from MySQL database
> <<< writing C# classes in file 'files\dblinq_mysql.vb'
> DbMetal: System.NullReferenceException: Object reference not set to an
> instance
> of an object.
> at DbMetal.Generator.CodeDomGenerator.GenerateTableClass(Table table,
> Databas
> e database) in
> z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\CodeDomGenerat
> or.cs:line 763
> at DbMetal.Generator.CodeDomGenerator.GenerateCodeDomModel(Database
> database)
> in
> z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\CodeDomGenerator.cs:line
> 175
> at DbMetal.Generator.CodeDomGenerator.Write(TextWriter textWriter,
> Database d
> bSchema, GenerationContext context) in
> z:\Development\DbLinq-0.20.1\src\DbMetal\
> Generator\CodeDomGenerator.cs:line 85
> at DbMetal.Generator.Implementation.Processor.GenerateCode(Parameters
> paramet
> ers, Database dbSchema, ISchemaLoader schemaLoader, String filename) in
> z:\Devel
> opment\DbLinq-0.20.1\src\DbMetal\Generator\Implementation\Processor.cs:line
> 234
> at DbMetal.Generator.Implementation.Processor.WriteSchema(Database
> dbSchema,
> ISchemaLoader schemaLoader, Parameters parameters) in
> z:\Development\DbLinq-0.20
> .1\src\DbMetal\Generator\Implementation\Processor.cs:line 178
> at DbMetal.Generator.Implementation.Processor.ProcessSchema(Parameters
> parame
> ters) in
> z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\Implementation\Proce
> ssor.cs:line 116
>
> C:\DATA_R~1\Temp\DBLINQ~1.1>
>
> Sid
>
>
> Avian Ambassadors - Flights of Education
> www.AvianAmbassadors.com
> The Bird Training Blog
> Behavior and Training Seminars
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of
> Jonathan Pryor
> Sent: Monday, January 10, 2011 12:43 PM
> To: [email protected]
> Subject: Re: [dblinq] Novice needs help
>
> On Jan 10, 2011, at 2:22 PM, Sid Price wrote:
>> Now, with the same command line as before I get a different error:
>>
>> DbMetal: Object reference not set to an instance of an object.
>
> A full stack trace would be useful. :-)
>
> - Jon
>
> --
> You received this message because you are subscribed to the Google Groups
> "DbLinq" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/dblinq?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "DbLinq" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/dblinq?hl=en.
>
> <winmail.dat>
--
You received this message because you are subscribed to the Google Groups
"DbLinq" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/dblinq?hl=en.