Apresenta erro ao compilar: Message=Unable to connect to any of the specified MySQL hosts.
Estou utilizando o Visual Studio Community 2013
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Loja.Entidades
{
class Produto
{
public virtual int Id { get; set; }
public virtual string Nome { get; set; }
public virtual double Preco { get; set; }
}
}
produto.hbm
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Loja"
namespace="Loja.Entidades">
<class name="Produto">
<id name="Id">
<generator class="identity"/>
</id>
<property name="Nome"/>
<property name="Preco"/>
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration
xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="dialect">
NHibernate.Dialect.MySQLDialect
</property>
<property name="connection.driver_class">
NHibernate.Driver.MySqlDataDriver
</property>
<property name="connection.connection_string">
Server=localhost;Database=loja; Uid=nhibernate; Pwd=caelum;
</property>
</session-factory>
</hibernate-configuration>
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Loja
{
class Program
{
static void Main(string[] args)
{
Configuration cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(Assembly.GetExecutingAssembly());
new SchemaExport(cfg).Create(true, true);
}
}
}