SqlMetal BUG?

14 views
Skip to first unread message

dra...@gmail.com

unread,
Mar 26, 2008, 2:39:15 AM3/26/08
to DbLinq
when i use "sqlmetal -Provider=Oracle -Server:localhost/aaaa -
Database: aaaa -user:bbb -password:ccc -code:ddd.cs" to generat
file,it display this message:

SqlMetal failed:System.ArgumentNullException: 值不能为空。
参数名: type
在 System.Activator.CreateInstance(Type type, Boolean nonPublic)
在 System.Activator.CreateInstance(Type type)
在 SqlMetal.LoaderFactory.Load(String connectionString, Type
dbLinqSchemaLoad
erType, Type databaseConnectionType) 位置 E:\Documents\My Projects
\dblinq2007\Sq
lMetal\LoaderFactory.cs:行号 42
在 SqlMetal.LoaderFactory.Load(String connectionString, String
dbLinqSchemaLo
aderType, String databaseConnectionType) 位置 E:\Documents\My Projects
\dblinq200
7\SqlMetal\LoaderFactory.cs:行号 51
在 SqlMetal.LoaderFactory.Load(SqlMetalParameters parameters) 位置 E:
\Documen
ts\My Projects\dblinq2007\SqlMetal\LoaderFactory.cs:行号 106
在 SqlMetal.Program.Main(String[] args) 位置 E:\Documents\My Projects
\dblinq2
007\SqlMetal\Program.cs:行号 60

then,i debug this project,and find this problem:
in LoaderFactory.cs ,line 43 "connection.ConnectionString =
connectionString;"
Now,the connectionString value is "server=localhost/aaa;user id=bbb;
password=ccc; database=aaa; pooling=false"
but when execut this line,raise a System.ArgumentException:"not
suppord keyword: “database”。"
the exception source is "System.Data.OracleClient".
i think,the connectionString is wrong.it should like this
"server=10.0.0.30/aaa;user id=bbb; password=ccc;pooling=false"
i try to change connectionString value ,then it succeed.
but in my code file "ddd.cs",my class have a empty class name and
constructor function name .

what should i do ?

Pascal Craponne

unread,
Mar 26, 2008, 3:12:16 AM3/26/08
to dbl...@googlegroups.com
You pointed out a weakness of SqlMetal: documentation :)
With Oracle, you must supply a connection string and a database:
SqlMetal /provider=oracle /database=MyDB /conn=.... /code=MyDB.cs (... and some other parameters you want)

2008/3/26 <dra...@gmail.com>:

gmo...@gmail.com

unread,
Mar 26, 2008, 5:36:54 PM3/26/08
to DbLinq
Pascal, I added error handling and comments to LoaderFactory.cs.

In Load(), could you also add a check for this Oracle-specific
condition?

Pascal Craponne

unread,
Mar 26, 2008, 6:17:40 PM3/26/08
to dbl...@googlegroups.com
Are you talking on the fact that SqlMetal may require a /database and a /conn ?
I think we can do something more general, like asking to specify a database name if the connection string doesn't provide it.

Do you agree with this?
Reply all
Reply to author
Forward
0 new messages