-
new to asp.net
HI,
I am quite conversant to vb.net and am trying to learn ASP.NET. I have this small tutorial of a log in class and am trying to see how it works right now.
It uses MySQL and in the web config it has these settings:
Code:
<configSections>
<section name="activeRecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler,Castle.ActiveRecord"/>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</configSections>
<appSettings/>
<!-- Connection String -->
<connectionStrings>
<add name="main" connectionString="Server=127.0.0.1;Port=3306;Database=nhibernate;User=root;Password=root;" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
<!-- Active Record-->
<activeRecord isWeb="true" isDebug="false" threadinfotype="Castle.ActiveRecord.Framework.Scopes.HybridWebThreadScopeInfo, Castle.ActiveRecord">
<config>
<add key="connection.driver_class" value="NHibernate.Driver.MySqlDataDriver"/>
<add key="dialect" value="NHibernate.Dialect.MySQL5Dialect"/>
<add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
<add key="connection.connection_string_name" value="main"/>
</config>
</activeRecord>
Can someone pls explain and help me out to converting it to SQLServer connection?
Thanks
-
Re: new to asp.net
You just need to change the connectionstring, check out connectionstrings.com it's perfect for all your connection string needs.
-
Re: new to asp.net
hi,
Any idea what the other setting mean pls such as ActiveRecord and nhibernate etc? What is the databasename ?
-
Re: new to asp.net
It all seems to be linked to the castle project.
The database name in your web.config is nhibernate
Code:
<connectionStrings>
<add name="main" connectionString="Server=127.0.0.1;Port=3306;Database=nhibernate;User=root;Password=root;" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
Note that your connectionstring will differ for use with a MSSQL server db.
-
Re: new to asp.net
NHibernate is a little advanced for you to be learning, don't you think?
How exactly did you come across this "log in class"? There are membership providers in ASP.NET that let you manage users, roles and memberships for your application. I don't see how jumping straight into ORM would benefit your learning of ASP.NET; that and there's the Entity Framework out now, it's much better than NHibernate.
-
Re: new to asp.net
Hi Mendhak,
I wasnt exactly looking for the NHiberate as I am new to ASP. It was just that my tutor indicated that I should look into design pattern such as MVC, that structures an application more clearly, with higher cohesion and lower coupling. So friend forwarded me the NHIbernate example ( if it has anything to do with that at all).
Anyway if there are any links showing the benefits of MVC and how it gets implemented ( with basic tutorials) I would appreciated it.
thanks
-
Re: new to asp.net
Well, I don't think you've been given a good place to start. NHibernate is all about databases and conceptual objects, it is more of a business logic+database concept.
If you want to learn about MVC, then ASP.NET just happens to have an MVC Framework that you can look at.
http://www.asp.net/mvc/
There are plenty of videos on that site too if you like those, they can be quite helpful.