Monday, January 14, 2013

ASP.NET MVC

What is MVC?
                          To know about mvc pattern click here.

Technical details required to know:


1. Web Matrix:

                          A good link is here.

2. Difference Between ASP and ASP.NET:
  1. ASP is interpreted, ASP.NET is compiled.
  2. Classic ASP uses a technology called ADO to connect and work with databases. ASP.NET uses the ADO.NET technology 
  3. ASP has Mixed HTML and coding logic where in asp.net html and coding part are separated by code behind files. 
  4. ASP.NET purely object oriented whereas ASP is partially object oriented. 
  5. For ASP No in-built support for XML whereas in ASP.NET full XML Support for easy data exchange.

     This answer is taken from here. See also.

3. Connection strings for asp.net mvc:

MVC 3 Connection String without SQLEXPRESS.
Change it in root web.config file


 <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
  </connectionStrings>

to ========>

 <connectionStrings>
        <add name="ApplicationServices" connectionString="server=MYDBSERVER;uid=MYUSERID;pwd=MYUSERIDPW;database=MYDB" providerName="System.Data.SqlClient" />
  </connectionStrings>



If you're using EF Code First then your connectionstring name must match the name of the DB Context. So if you have MoviesContext as the DB Context then you should have the same name for the connectionstring.
EF Code First uses a lot of conventions so if it doesn't find a connection string named as the DB Context will try to connect to a SQLExpress (doesn't care if there is not one installed) and will look for/create the database with a very long name: Namespace.MovieContext

                    If you face any problem regarding vs 2010 sp1 installation.
see this => an important information.


Difference between get and post method:

               http://en.wikipedia.org/wiki/POST_(HTTP)
               http://forums.asp.net/t/1727293.aspx/1
               http://forums.asp.net/t/1173435.aspx/1

No comments:

Post a Comment