--
You received this message because you are subscribed to the Google Groups "DbLinq" group.
To post to this group, send email to dbl...@googlegroups.com.
To unsubscribe from this group, send email to dblinq+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dblinq?hl=en.
Thank you for your reply. Here is my attempt to run DbMetal. You will see it fails I would appreciate any help/pointers.
Â
C:\Data_Root\Temp\DbLinq-0.20.1>dbmetal.exe --provider=Mysql --server=192.168.0.7 --database=in_out --user=sid --password=xxxxxx --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)
Â
DbMetal: Could not load databaseConnectionType type 'MySql.Data.MySqlClient.MySq
lConnection, MySql.Data'. Try using the --with-dbconnection=TYPE option.
Â
Sid.
Â
Avian Ambassadors - Flights of Education
Dim strConn As String = "server=192.168.0.7;User
Id=sid;pwd=xxxxx;database=mysql;Persist Security Info=True"
Dim oConn As New MySql.Data.MySqlClient.MySqlConnection(strConn)
oConn.Open()
oConn.Close()
This works fine so that tells me the connector is installed correctly, is
that right?
Sid.
Avian Ambassadors - Flights of Education
<http://avianambassadors.com/BirdTraining/> The Bird Training Blog
<http://www.behaviorandtraining.com/> Behavior and Training Seminars
From: dbl...@googlegroups.com [mailto:dbl...@googlegroups.com] On Behalf Of
Sadik Eser
Sent: Monday, January 10, 2011 11:13 AM
To: dbl...@googlegroups.com
Subject: Re: [dblinq] Novice needs help
reinstall mysql .net connector and
ensure that, Mysql.Data.dll exists in c:\windows\assembly folder or the same
folder with dbmetal.exe
2011/1/10 Sid Price <sidp...@avianambassadors.com>
Thank you for your reply. Here is my attempt to run DbMetal. You will see it
fails I would appreciate any help/pointers.
C:\Data_Root\Temp\DbLinq-0.20.1>dbmetal.exe --provider=Mysql
--server=192.168.0.7 --database=in_out --user=sid --password=xxxxxx
--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)
DbMetal: Could not load databaseConnectionType type
'MySql.Data.MySqlClient.MySq
lConnection, MySql.Data'. Try using the --with-dbconnection=TYPE option.
Sid.
Avian Ambassadors - Flights of Education
The Bird Training Blog <http://avianambassadors.com/BirdTraining/>
Behavior and Training Seminars <http://www.behaviorandtraining.com/>
Best regards
Sadık Eser
2011/1/10 Sid Price <sidp...@avianambassadors.com>
Hello,
Many thanks,
Sid.
<mailto:dblinq%2Bunsu...@googlegroups.com> .
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 dbl...@googlegroups.com.
To unsubscribe from this group, send email to
dblinq+un...@googlegroups.com
<mailto:dblinq%2Bunsu...@googlegroups.com> .
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 dbl...@googlegroups.com.
To unsubscribe from this group, send email to
dblinq+un...@googlegroups.com
<mailto:dblinq%2Bunsu...@googlegroups.com> .
Specifically, you need to let dbmetal know about it; see:
http://code.google.com/p/dblinq2007/wiki/Installation#To_run_DbMetal
Specifically, you need to either copy the MySql.Data.dll assembly into the same directory as DbMetal.exe, or edit the DbMetal.exe.config file to reference the correct fully-qualified assembly name.
You will also need to follow the instructions in the "To use DbLinq" section.
- Jon
Sid.
Avian Ambassadors - Flights of Education
www.AvianAmbassadors.com
The Bird Training Blog
Behavior and Training Seminars
Now, with the same command line as before I get a different error:
DbMetal: Object reference not set to an instance of an object.
Sid.
Avian Ambassadors - Flights of Education
www.AvianAmbassadors.com
The Bird Training Blog
Behavior and Training Seminars
A full stack trace would be useful. :-)
- Jon
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: dbl...@googlegroups.com [mailto:dbl...@googlegroups.com] On Behalf Of
Jonathan Pryor
Sent: Monday, January 10, 2011 12:43 PM
To: dbl...@googlegroups.com
Subject: Re: [dblinq] Novice needs help
- Jon
--
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.
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
> <winmail.dat>
C:\DATA_R~1\Temp\DBLINQ~1.1>dbmetal.exe /provider:MySQL /server:192.168.0.7
/database:in_out /user:sid /password:xxxxxx /dml:foo.dbml /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 DBML file '/dml:foo.dbml'
DbMetal: System.NotSupportedException: The given path's format is not
supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path,
Boolean needFullPath)
at
System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[]
str, Boolean needFullPath)
at
System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAcc
ess access, AccessControlActions control, String[] pathListOrig, Boolean
checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at
System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccessacc
ess, AccessControlActions control, String[] pathList, Boolean
checkForDuplicates, Boolean needFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access,FileShare share)
at DbMetal.Generator.Implementation.Processor.ReadSchema(Parameters
parameters, String filename) in
z:\Development\DbLinq-.20.1\src\DbMetal\Generator\Implementation\Processor.c
s:line 273
at DbMetal.Generator.Implementation.Processor.ReadSchema(Parameters
parameter
s, ISchemaLoader& schemaLoader) in
z:\Development\DbLinq-0.20.1\src\DbMetal\Generator\Implementation\Processor.
cs:line 241
at DbMetal.Generator.Implementation.Processor.ProcessSchema(Parameters
parameters) in
z:\Development\DbLinq-.20.1\src\DbMetal\Generator\Implementation\Processor.c
s:line 110
Correct the option name. :-)
- Jon
Again, thanks, hopefully I can now make some progress with my research.