Имеющий Что Сказать
Зарегистрирован: 27 April 2008
Сообщения: 56
Примеры кода: 0
|
Как правильно разместить файлы проекта на сервере? |
29 May 2008 18:05 |
|
|
|
|
А как будет выглядеть эта строка соединения с БД? то есть Вы хотите сказать, что в web.config DataDirectory будет выглядеть иначе? А в файлах проекта? Там сейчас просто стоит ссылка на MyDataBase.mdf.
Я уже понял кое-что, добрался до экспорта БД на сервере. Указал свою из папки с отбилденным проектом.
XMLники лежат в руте. Путь к ним такой, как Вы указали.
Вот таким образом:
doc.Load(Server.MapPath("guestbook.xml"));
Я думаю, может, я в web.config как-то должен путь поменять. Вот тока не знаю, как он выглядеть должен. Вот web.config
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated
Security=True;User Instance=True;AttachDBFilename=|DataDirectory|ASPNETDB.MDF" />
<add name="MySampleConnectionString1" connectionString="Data Source=.\SQLExpress;Integrated
Security=True;User Instance=True;AttachDBFilename=|DataDirectory|MySample.mdf"
providerName="System.Data.SqlClient" />
<add name="MySampleConnectionString2" connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\MySample.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
Что с XMLями не то... не знаю... на локальной машине все работает.
А вот и попытка импортировать БДRuntime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
Спасибо, что откликнулись!
Логика - друг программера...
Данное сообщение получено с сайта GotDotNet.RU
|
|