asp.net mvc - When connecting to SQL Server what are the values for the datasource? -
basically i'm developing website using asp.net mvc4, when creating model, need establish connection database first
when selected database name 7ch3lm1
(default in drop down list), said:
cannot connect database
but when wrote 7ch3lm1\sqlexpress
, let me through
that reminded me of question: what's real difference behind that? what's meaning of 7ch3lm1
, what's point adding sqlexpress
?
any ideas welcomed!
7ch3lm1
machine name, , helps identify instance of sql server you're connecting to. in case, connecting named instance of sql server running express edition, , instance name sqlexpress
. machine can run multiple instances of sql server concurrently, , can have 1 default instance , 0, 1 or multiple named instances. connect default instance, use 7ch3lm1
, , connect named instance, use 7ch3lm1\<instance name>
, have 7ch3lm1\sqlexpress
.
i typically rename machines little more memorable , meaningful, can make things easier, that's me.
an instance of sql server can contain many databases. can specify database in connection string (recommended), or can rely on login's default database define initial context (not recommended, since database offline, single user, detached, etc. - affect ability log in).
ultimately, software need both instance , database in order read / write data.
Comments
Post a Comment