I have developed a web application using MS Visual Web Developer 2k5
and it works to my liking. I now need it to be live (ASAP) and want to
move it from my development machine to my server. I have copied the
web site to the server (using the copy feature of vwd 2k5), including
the app_data directory which contains the aspnetdb.mdf file that is
used for membership and security.
In this app, I also connect to a sql server database that I've
designed (let's call it EventManager which is on the default instance
of sql server (.\sqlexpress) on my development machine. To get this
database (I don't really need the data, just the structure) onto the
server, I copied the corresponding files (.mdf and .ldf) to the
correct folder on the server and then attached the mdf using microsoft
sql server management studio express.
Trying to access this web app produces the following:
<BEGIN ERROR>
Server Error in '/' Application.
Instance failure.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Instance failure.
Source Error:
Line 53: Dim eventsToday As DataView
Line 54: Dim arguments As New DataSourceSelectArguments()
Line 55: eventsToday = SqlDataSource1.Select(arguments) <-line is red
Line 56:
Line 57:
Source File: C:\Inetpub\EMRoot\EventCalendar.ascx.vb Line: 55
Stack Trace:
[InvalidOperationException: Instance failure.]
System.Data.SqlClient.TdsParser.Connect(Boolean&
useFailoverPartner, Boolean& failoverDemandDone, String host, String
failoverPartner, String protocol, SqlInternalConnectionTds
connHandler, Int64 timerExpire, Boolean encrypt, Boolean
trustServerCert, Boolean integratedSecurity, SqlConnection
owningObject, Boolean aliasLookup) +684031
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String
newPassword, Boolean redirectedUserInstance) +628
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options)
+28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +137
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments
arguments) +1770
System.Web.UI.WebControls.SqlDataSource.Select(DataSourceSelectArguments
arguments) +16
EventCalendar.Calendar1_DayRender(Object sender, DayRenderEventArgs
e) in C:\Inetpub\EMRoot\EventCalendar.ascx.vb:55
System.Web.UI.WebControls.Calendar.OnDayRender(TableCell cell,
CalendarDay day) +419
System.Web.UI.WebControls.Calendar.RenderDays(HtmlTextWriter
writer, DateTime firstDay, DateTime visibleDate, CalendarSelectionMode
selectionMode, Boolean buttonsActive, Boolean useAccessibleHeader)
+2345
System.Web.UI.WebControls.Calendar.Render(HtmlTextWriter writer) +1053
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +130
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +130
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +121
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +130
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1896
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.42
<END ERROR>
The application is set up to use forms authentication and the
connection string in the web.config is set up to use integrated
security, as is sql express on the server.
I've added a login to sql express on the server for NT
AUTHORITY\NETWORK SERVICE and gave it the same privelages and settings
that the {machine name}\ASPNET user has in sql express on my
development machine (the server uses IIS6 and the dev machine uses IIS
5). This, however does not fix the problem, I still get the same
error.
I also tried copying just the structure of the database by creating
scripts of all my database objects (including the database) and
running these scripts on the server. While this created the structure,
it still did not solve my problem. |