строка подключения экспресса SQL-сервера

Вы могли также попробовать posix_memalign() (на платформах POSIX, конечно).

9
задан p.campbell 7 August 2009 в 20:09
поделиться

6 ответов

По умолчанию (хотя я не рекомендую 1 ) Sql Express устанавливается как именованный экземпляр . Это означает, что вы должны подключаться как Server = servername.com \ SQLEXPRESS , а не просто Server = servername.com .

Как всегда, connectionstrings.com есть полезные свойства.

1 Я не рекомендую именованные экземпляры, потому что они работают на другом порту , что делает межсетевой экран PITA. Кроме того, для меня не имеет смысла запускать более 1 сервера MSSQL на компьютере, если вместо этого вы можете просто разместить несколько баз данных - так что я не совсем уверен, в чем смысл.

14
ответ дан 4 December 2019 в 13:49
поделиться

Единственное отличие состоит в том, что вам нужно будет указать именованный экземпляр в строке conn, если Express был настроен таким образом. У 2005 года не было выбора, а у 2008 года.

Data Source=localhost\SQLExpress

Вот отличный справочник по строкам подключения .

0
ответ дан 4 December 2019 в 13:49
поделиться

Да, есть разница - большая разница в том, что у вас не будет AttachDbFilename в полной версии SQL Server.

Строка подключения SQL Server Express:

Server=.\SQLExpress;AttachDbFilename=c:\mydbfile.mdf;Database=dbname; Trusted_Connection=Yes;

Типичная обычная строка подключения SQL Server :

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

См. connectionStrings.com для получения дополнительной информации.

0
ответ дан 4 December 2019 в 13:49
поделиться

Строка подключения, используемая для доступа к SQL Server и SQL Server Express?

Как правило, нет. Это хорошая вещь в использовании Express; разработайте с его помощью локально и с минимальными изменениями перенесите доступ к данным на SQL Server.

1
ответ дан 4 December 2019 в 13:49
поделиться

I recently downloaded a sample application from the Telerik site and could not get it to run on my machine that has only SQL Server 2008 SP1 Developer Edition installed until I did a find and replace of all "User Instance=True" with "User Instance=False".

Before anybody goes and gets their panties all twisted in a knot, hear me out first. My circumstances may be (but ought not be) unique in that instead of installing SQL Server 2008 Express just to run example applications (e.g., Telerik), I simply installed a second named instance of SQL Server named, you guessed it, sqlexpress on my copy of SQL Server 2008 Developer Edition. That way when the Telerik (or you name it) demo application tries to connect to "Data Source=.\sqlexpress", it's none the wiser that what it's really connecting too is "big SQL Server" (which is what SQL Server Developer Edition is for the purposes of this posting).

The key conecpts (dare I say "money quote") you need to understand are these:

SQL Express allows (actually assumes if missing) User Instance=True, so if you are running a named instance called sqlexpress on "big SQL" (Developer, Standard, Enterprise or Data Center), then you just need to find/replace User Instance=True with User Instance=False in the connecton string and your worries are over. Even the "Attach database" stuff (that I see in the Telerik connectionStrings section of their web.config) works on "big SQL" (contrary to what somebody posted earlier in this thread).

Here's an actual example taken directly from the web.config of the Telerik web.config file after I "fixed it up":

<connectionStrings>
    <add name="NorthwindConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient"/>
    <add name="TelerikConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient"/>
    <add name="NorthwindConnectionString35" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Northwind.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient"/>
    <add name="TelerikConnectionString35" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|Telerik.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient"/>
    <add name="NorthwindEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Northwind.mdf;Integrated Security=True;User Instance=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
    <add name="TelerikEntities" connectionString="metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Telerik.mdf;Integrated Security=True;User Instance=False;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
    <add name="EditorFileBrowserDatabase" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|EditorDBStorage.mdf;Integrated Security=True;User Instance=False" providerName="System.Data.SqlClient"/>
</connectionStrings>
0
ответ дан 4 December 2019 в 13:49
поделиться

В дополнение к предыдущему посту: если у вас проблемы с Setup Teleerik Samples на MSSQL Server 2008, вы можете сделать следующее:

  1. Open Livedemos Teleerik vs Solution
  2. Соединения для баз данных на настройке для файлов Teleerik .mdf в VS
  3. Копировать соединительную строку для подключений к файлу Web.config
  4. и добавить «интегрированную безопасность = True; User Axcast = False» до конца строк.

. Фред Моррисон - спасибо, ты мой «человек день», я просто исправил Teleerik Live Demo Shood с вами, помогите!

0
ответ дан 4 December 2019 в 13:49
поделиться
Другие вопросы по тегам:

Похожие вопросы: