c# - Connection string for Fluent Nhibernate with MySQL -
i've reviewed post how configure fluent nhibernate mysql, i'm relatively new mysql , need set connection string itself. i've installed mysql part of wamp install , need fill in actual connection string. can me extending linked answer contain full connection string example?
appreciated.
edit: i've tried several different things , keep getting following error message:
can't load file fluentconfiguration.cs under d:\builds\fluentnh-v1.x-nh3\src\fluentnhibernate\cfg. check file permission , existence of file.
i installed fnh via nuget, , don't understand why it's looking @ path, d: drive cd , not harddisk. confused.
the error you've pasted looks visual studio trying localise sources show exception comes from. not real exception message - should have somewhere there , it's wrong configuration.
if you've installed wamp default settings, configured listen on 3306 port , have local root
account without password. connection string should somehow that:
server=localhost; port=3306; database=[database_name_here]; uid=root; pwd=;
(pwd=
part may not needed @ all).
so need paste in app.config
/web.config
's <connectionstrings>
section:
<connectionstrings> <add name="connectionstring" connectionstring="server=localhost; port=3306; database=[database_name_here]; uid=root; pwd=;" providername="system.data.sqlclient" /> </connectionstrings>
and use solution linked question:
mysqlconfiguration.standard.connectionstring( c => c.fromconnectionstringwithkey("connectionstring") )
alternatively, can paste connection string directly in fluent's configuration, this:
mysqlconfiguration.standard .connectionstring.is("server=localhost; port=3306; database=[database_name_here]; uid=root; pwd=;")
anyway, default root/no password configuration can used local development , testing purposes.
Comments
Post a Comment