Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI
>>>am new in MVC Application...
>>>Give some basics idea in mvc,differ b/w MVC2&MVC3..
>>>how to manipulating data MVC2 with sql 2008-r2..
Posted
Updated 16-Jan-14 19:12pm
v2
Comments
Sandeep Singh Shekhawat 17-Jan-14 1:16am    
Why are you trying with MVC2 that has ASPX view engine you should go with MVC3/MVC4/MVC5 with razor view engine. That has easy to development.

1 solution

Following si the connection string

DataSource = 192.168.10.3
Initial Catalog = MyDB
User ID = whatever sql login you are using to access your SQL Server
Password = password for the sql login above


You can define connection string in web.config as follows.

<add name="SampleConnection" connectionstring="metadata=res://*/Models.DataModels.AECDB.csdl|res://*/Models.DataModels.AECDB.ssdl|res://*/Models.DataModels.AECDB.msl;provider=System.Data.SqlClient;provider connection string="data source=SERVER2012S\SQL2008S;initial catalog=DatabaseName;persist security info=True;user id=cisuser;password=Passwrd;multipleactiveresultsets=True;application name=EntityFramework"" providername="System.Data.EntityClient">


You can find out the sample connection strings from the follwing site

http://www.connectionstrings.com/sql-server-2008/[^]


some sample links of mvc


http://www.asp.net/mvc/tutorials/mvc-5/introduction/creating-a-connection-string[^]

http://www.docstorus.com/viewer.aspx?code=e474571d-efa8-4022-8883-18204e7623ea[^]


We can do MVC by using following methods
1. Database first
2. Code first
3. Model first

you can easily find above methods from Google search
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900