Das Blog

Debugging one line at a time
$1*/ mo WordPress hosting! Get going with GoDaddy!
Menu
  • Home
  • Coding
    • Entity Framework
    • MVC
    • NHibernate
  • JavaScript
    • TypeScript
  • Hosting
  • SEO
  • Social
  • Database
    • MySql
    • SSIS
  • WP
  • Other
    • CakePHP
    • Error Messages
    • Google Maps
Home
Database
MySql
Setup MySql to work with Sharp Architecture and Nhibernate
MySql

Setup MySql to work with Sharp Architecture and Nhibernate

Codex Discipulus February 11, 2010

Sharp Architecture and specifically NHibernate can be setup to work with most of the databases out there. The Nhibernate.config file comes setup to work with SQL Server out-of-the-box. Setting up NHibernate to work with MySql is not difficult. MySql database server provides a robust solution to any application and good savings compared to other databases, many hosts like GoDaddy or FatCow provide cheap alternatives to hosting and many plans with unlimited MySql Databases. Follow this steps to setup MySql in Sharp Architecture using NHibernate:

  1. Download Connector-Net 6.2.2 from “http://dev.mysql.com/downloads/connector/net/”
  2. Unzip and run “mysql.data.msi” to install.

    MySql Connector setup screen

    MySql Connector setup screen

  3. After installation is completed, you can find the required DLLs in the default directory: C:\Program Files\MySQL\MySQL Connector Net 6.2.2\Assemblies
    MySql Connector installed dlls

    MySql Connector installed dlls

  4. Open NHibernate.config from your project and change the following:
    • “connection.driver_class” property value : change “NHibernate.Driver.SqlClientDriver” to “NHibernate.Driver.MySqlDataDriver“
    • “dialect” property value : change “NHibernate.Dialect.MsSql2005Dialect” to “NHibernate.Dialect.MySQLDialect“
    • Change “connection.connection_string” to your MySql database settings.
      EX: Data Source=localhost;Database=MyDB;UID=myUser;pwd=7HYSAYG2;
  5. Copy Assemblies: “MySql.Data.dll” and “MySql.Web.dll” from C:\Program Files\MySQL\MySQL Connector Net 6.2.2\Assemblies to your local “lib” folder in your project.
  6. Add as references to your {projectName}.Web project. Once added, right click to get to Properties and make sure “Copy Local” is set to TRUE for both Dlls.
Share
Tweet
Google+
Linkedin
Stumble
Email
Next Article

Related Articles

Date and Time
Mapping between MySql data types Boolean and DateTime and Sharp …

How to map DateTime and Boolean data types to MySql using NHibernate and Sharp CRUD Scaffolding.

About The Author

Codex Discipulus

Hello, my name is David and I am a disciple of coding, always learning and always ready to help. Welcome to my blog, I hope you find it useful, please send your comments and share an article with your friends.

Leave a Reply

Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts

  • Hosting ASP.Net Core 3.x Worker Service as …
    Using the Worker template now is possible to host an …
  • Calling an HTTPS WCF Service from Net …
    We all know how to call a WCF service from …
  • How to Add a VS Code Project …
    Let’s try to add a Visual Studio Code project to …
  • Step by Step Token based Authentication in …
    Token Authentication is a very popular method to secure a …
  • How to Ignore NuGet Packages in TFS …
    This should be a short post. It is really just …

Categories

  • CakePHP
  • Coding
  • Database
  • Entity Framework
  • Error Messages
  • General
  • Google Maps
  • Hosting
  • JavaScript
  • MVC
  • MySql
  • Net Core
  • NHibernate
  • SEO
  • SSIS
  • TypeScript
  • Wordpress

Tags

ActiveDirectory analytics apps aspnet CakePHP coding database projects design patterns entity framework error messages fatcow first steps ftp github gitlab godaddy google maps api hangfire Hosting iis7 java javascript membership MVC MySql NHibernate nuget nuget packages oracle owin repository SEO sharp ssis t4 tfs thesis token authentication typescript vs2010 vs2015 vs2017 web api Wordpress wp-pagenavi

Das Blog

Debugging one line at a time
Copyright © 2020 Das Blog
ScottsdaleWebStudio.com © All Rights Reserved 2017