I'm developing a .net project and I use the first time SQL Server 2012 with fluent nhibernate when I running my project I get the following error =>
Value cannot be null.
Parameter name: Data Source
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: Data Source
My configuration syntax
Fluently.Configure()
.Database(
MsSqlConfiguration.MsSql2012.ConnectionString(c => c.FromAppSetting("ConnectionString")))
.Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()))
.CurrentSessionContext<T>()
.BuildSessionFactory();
and my connection string in web.config:
<connectionStrings>
<add name="ConnectionString"
connectionString="Data Source=localhost; Initial Catalog=ExcelReport; Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>
I've tried various ways but I couldn't fix the problem. Do you have any suggestion?
SELECT @SERVERNAMEin a query window, and use the returned value in your Data Source Proerty. - M.Ali