Error ASP.NET

Posted on Oktober 10, 2013. Filed under: ASP.NET, Information Technology, VB.NET | Tag:, |

Error    1    Type ‘HtmlTextWriter’ is not defined.

SOLVE :
Imports System.Web.UI

Error    5    Type ‘HttpContext’ is not defined.    D:\…..\FormRewriter.vb
SOLVE : Add Reference to project with System.Web

Error    1    Could not load type ‘PageBase’.

SOLVE :
http://anandganesh2005.blogspot.com/2011/02/could-not-load-type-pagebase.html

 

 

Q : Is there a utility that will allow me to see what users on my network are
connected/active on SQL server?
A : sp_who which is documented or sp_who2 which is similar but technically not
documented.

A : select a.session_id, b.login_name

from sys.dm_exec_connections a, sys.dm_exec_sessions b

where a.session_id = b.session_id

ERROR:

SOLVE:
check table structure & make sure it has PK (Primary Key)

ERROR :

Server Error in '/personalDesignVB v8' Application.

The database 'E:\ASPNETVBPRJ\PERSONALDESIGNVB V8\APP_DATA\ASPNETDB.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported.
Could not open new database 'E:\ASPNETVBPRJ\PERSONALDESIGNVB V8\APP_DATA\ASPNETDB.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file E:\ASPNETVBPRJ\personalDesignVB v8\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

SOLUTION:
In Visual Studio: Tools → Options → Database Tools → Data Connections, then change the ‘SQL Server Instance Name’ to the appropriate one.

rebuild all solution,
deleting the ASPNETDB.MDF and aspnetdb_log.ldf files from the App_Data folder Using SQL 2008 MANAGEMENT STUDIO. They get recreated the next time you run your application.

CAUSE :
Visual Studio doesn’t know which SQL Server instance it should use, so you can specify the proper instance.

ERROR :
Failed to generate a user instance of SQL Server due to failure in retrieving the user’s local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.

SOLVE :

Resolution for Windows 7 and Windows Server 2008 R2

For all web applications running under IIS 7.5, regardless of their project type, carry out the following steps:

  1. Run the Internet Information Services (IIS) Manager tool. This tool can be accessed either from the Administrative start menu, or by typing “inetmgr” in the Windows Start–>Search textbox and selecting the inetmgr tool.
  2. In the left-hand pane of the IIS Manager tool expand the machine node. Click on the “Application Pools” node so that the application pools display in the main window of the management tool.
  3. If you are troubleshooting an ASP.NET 2.0/3.0/3.5 application select the “DefaultAppPool” application pool. For ASP.NET v4 select the “ASP.NET v4.0” application pool.
  4. Right-click on the selected application pool and choose “Advanced Settings”
  5. In the “Advanced Settings” dialog box find the category called “Process Model”. The first row in the category will be the “Identity” row.
  6. Click on the “Identity” row and then click on the small button that shows on the right-hand side of the value cell. The button displays the text “…”
  7. A dialog box called “Application Pool Identity” will popup. Within that dialog box there are two radio buttons. Make sure the first radio button titled “Built-in Account” is selected.
  8. In the dropdown box below the radio button choose “Network Service” for the identity.
  9. Click “Ok” to close out the “Application Pool Identity” dialog box.
  10. Click “Ok” to close out the “Advanced Settings” dialog box.
  11. At this point the changes to the application pool identity will have been saved to IIS 7.5’s configuration store.

Resolution for Web Application Projects and Websites

For web application projects (WAP) and websites located in a user’s Documents Folder hosted under any version of IIS running as NETWORK SERVICE, carry out the following steps:

  1. First confirm that IIS has been configured to run as NETWORK SERVICE. This is the default on IIS6 and IIS7. However if you are running on Windows 7 or Window Server 2008 R2 you will first need to follow the steps above in “Resolution for Windows 7 and Windows Server 2008 R2” to make IIS application pools run as NETWORK SERVICE.
  2. From a command prompt, type net stop iisadmin /y . This will cause any running ASP.NET WAP applications to shutdown.
  3. Exit out of all running Visual Studio instances.
  4. NETWORK SERVICE must be granted Read permission to the top-level Visual Studio folder located in your user’s Documents folder. The Visual Studio folder will have different names depending on the version: “Visual Studio 2005”, “Visual Studio 2008”, or “Visual Studio 2010”.
  5. NETWORK SERVICE must be granted both read and write permissions to your project’s top-level project folder. For example if your WAP project is called “MyCustomWebProject”, then the folder “Documents\Visual Studio 20xx\Projects\MyCustomWebProject” needs to have read and write access enabled for NETWORK SERVICE. Or, if your webiste project is called “MyCustomWebProject”, then the folder “Documents\Visual Studio 20xx\Websites\MyCustomWebProject” needs to have read and write access enabled for NETWORK SERVICE.
  6. NETWORK SERVICE must be granted both read and write permissions to the App_Data folder located within your web project’s directory structure.

 

 

Jun 18, 2013 @ 17:01

PROBLEM : Record is always added with space character

CAUSE : it’s using NChar DataType

SOLVE : use char or VarChar DataType instead of NChar

Problem : Error pas upload website & database ke free hostingan di AspSpider.com

Server Error in ‘/muupeetz’ Application.


Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

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.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050282
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +183
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5063943
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +95
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +206
   System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +832
   System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +469
   System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +280
   System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +158
   System.Configuration.SettingsBase.get_Item(String propertyName) +118
   System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36
   System.Web.Profile.ProfileBase.get_Item(String propertyName) +77
   PageBase.get_StyleSheetTheme() +51
   System.Web.UI.Page.InitializeStyleSheet() +37
   ASP.default_aspx.FrameworkInitialize() +19
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +54
   System.Web.UI.Page.ProcessRequest() +78
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.default_aspx.ProcessRequest(HttpContext context) +4
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Penyebab : local database udah pake yg SQL 2008 Express sementara udah di convert jadi 2005 Express juga masih tetep error, keliatan pas nge-attach ga kebentuk ASPNETDB.MDF & LDF nya.. jadi bisa di-Detach, klo berhasil biasanya ga akan bisa di-Detach jadi kudu di delete all site (re-create ulang website)😦

mungkin krn. instancenya udah gw rubah jadi sqlexpress2k5 begitu diupload ga bisa.. mungkin dia kudu pake instance sqlexpress,, sementara instance sqlexpress -> sqlexpress 2008 bawaan gara2 install VS2010 Pro.

Solusi : uninstall local sqlexpress2008 , attach database ke 2005 express lagi coba lagi.. mending mana ? yg penting Free Hosting jalan..😦

Problem:

pas running website muncul error :

Server Error in ‘/personalDesignVB v6 – SQL2008ExpressR1 can’t host in AspSpider.com’ Application.


Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

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.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

Source Error:

Line 19:     Public Overrides Property StyleSheetTheme() As String
Line 20:         Get
Line 21:             Return HttpContext.Current.Profile("StylesheetTheme").ToString()
Line 22:         End Get
Line 23:         Set(ByVal value As String)

Source File: D:\personalDesignVB v6 – SQL2008ExpressR1 can’t host in AspSpider.com\App_Code\PageBase.vb Line: 21

Stack Trace:

[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4856599
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1121
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +340
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +225
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4868323
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +431
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221
   System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +772
   System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +433
   System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +258
   System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +132
   System.Configuration.SettingsBase.get_Item(String propertyName) +102
   System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36
   System.Web.Profile.ProfileBase.get_Item(String propertyName) +68
   PageBase.get_StyleSheetTheme() in D:\personalDesignVB v6 - SQL2008ExpressR1 can't host in AspSpider.com\App_Code\PageBase.vb:21
   System.Web.UI.Page.InitializeStyleSheet() +39
   System.Web.UI.Page.FrameworkInitialize() +19
   ASP.default_aspx.FrameworkInitialize() in D:\personalDesignVB v6 - SQL2008ExpressR1 can't host in AspSpider.com\Default.aspx.vb:912306
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +56
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.default_aspx.ProcessRequest(HttpContext context) +37
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Version Information: Microsoft .NET Framework Version:2.0.50727.5466; ASP.NET Version:2.0.50727.5456

SOLUSI : http://www.aspdotnetfaq.com/Faq/fix-error-Failed-to-generate-a-user-instance-of-SQL-Server-due-to-a-failure-in-starting-the-process-for-the-user-instance.aspx

Solve login failed error for IIS APPPOOL\DefaultAppPool

I recently ran into the classic SQL Server connection error message “Login failed”. This, of course, nearly always has to do with insufficient rights to the database.

However, I also got this error message:

Login failed for user 'IIS APPPOOL\DefaultAppPool

In this case, I tried to anonymously connect to a SQL Server Database (in Windows 7, mind).

This is how to solve the problem:

  1. In Internet Information Services, right click the website that tries to connect to the database->choose Manage Web Site -> Advanced Settings. Take a look at the Application Pool used, in this case DefaultAppPool:
    IIS Application Pool settings
  2. Now that you know the application pool the website uses, instead right click Application Pools (in IIS root) -> right click the correct application pool -> choose Advanced Settings.
  3. Under Advanced Settings, find Identity and choose LocalService as the Built-in account (or LocalSystem if that’s the option you’ve got):
    Change Application Pool Identity to LocalService
  4. Done!

Make a Comment

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d blogger menyukai ini: