I , Me , Myself
- Sachin
- Hi .. This is Sachin Uchil. I have been in the field of .NET development for about 2 years now. Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Thursday, February 07, 2008
Failed to access IIS metabase. Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase. The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Solution : this error can mean one thing.. u installed iis after installing .net.
cmd>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Aspnet_regiis –i
Solution : this error can mean one thing.. u installed iis after installing .net.
cmd>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Aspnet_regiis –i
Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Error when .. clicked on logout in admin home page
Solution:
Error when .. clicked on logout in admin home page
Solution:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Error on Conn.Open()
Error on Conn.Open()
Control 'ctl00_ContentPlaceHolder1_gv' of type 'GridView' must be placed inside a form tag with runat=server.
Z code
Response.Clear()
Response.AddHeader("Content-Disposition", "inline;filename=Backup.xls")
Response.Charset = "iso-8859-1,windows-1252"
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentEncoding = System.Text.Encoding.UTF7
Response.ContentType = "application/vnd.ms-excel"
Page.EnableViewState = False
Dim strwrite As New System.IO.StringWriter
Dim htmwrire As New System.Web.UI.HtmlTextWriter(strwrite)
'gv.Columns(0).Visible = "False"
GridView1.RenderControl(htmwrire)
Response.Write(strwrite.ToString())
Response.End()
Z Method to include on the page
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As System.Web.UI.Control)
End Sub
Z code to be added in Page directive
<%@ Page EnableEventValidation="false" %>
Z code
Response.Clear()
Response.AddHeader("Content-Disposition", "inline;filename=Backup.xls")
Response.Charset = "iso-8859-1,windows-1252"
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentEncoding = System.Text.Encoding.UTF7
Response.ContentType = "application/vnd.ms-excel"
Page.EnableViewState = False
Dim strwrite As New System.IO.StringWriter
Dim htmwrire As New System.Web.UI.HtmlTextWriter(strwrite)
'gv.Columns(0).Visible = "False"
GridView1.RenderControl(htmwrire)
Response.Write(strwrite.ToString())
Response.End()
Z Method to include on the page
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As System.Web.UI.Control)
End Sub
Z code to be added in Page directive
<%@ Page EnableEventValidation="false" %>
Thursday, June 14, 2007
Theme 'XYZ' cannot be found in the application or global theme directories.
The themes in ur site have to be placed in App_Themes folder. Even if u have done this, sometimes the system throws the above error.To solve this...
1> Make sure u have ur .css and .skin file in the folder named 'XYZ'
2> Copy this folder to the location "C:\Windows\ Microsoft.NET\ Framework\ v2.0.50727\ ASP.NETClientFiles\Themes".
3> If u have uploaded the file on a server also make sure u have the folder at the following path:
"\wwwroot\aspnet_client\system_web\v2.0.50727\Themes"
Wednesday, May 23, 2007
Login failed for user "Sachin"
There is a very simple solution for this...
just check the connection string you have used, wrong values in the connection string cause this error.
Check if the username and password you are using for connection are correct for the specified database.
If u dont know the Username n Password try "sa" as username and a blank password.
And if this dosent work try this ...
1. Click Start - Programs - Microsoft SQL Server - Enterprise Manager to open the Enterprise Manager.
2. Connect to the appropriate Server if the SQL is a client installation.
3. Right click on the Server Node and click on Properties.
4. This opens the Properties Dialog.
5. Switch to the Security Tab.
6. Under the Security section, make sure the Option SQL Server and Windows is selected.
7. This ensures that your SQL Server is running under Mixed Mode Authentication.
There is a very simple solution for this...
just check the connection string you have used, wrong values in the connection string cause this error.
Check if the username and password you are using for connection are correct for the specified database.
If u dont know the Username n Password try "sa" as username and a blank password.
And if this dosent work try this ...
1. Click Start - Programs - Microsoft SQL Server - Enterprise Manager to open the Enterprise Manager.
2. Connect to the appropriate Server if the SQL is a client installation.
3. Right click on the Server Node and click on Properties.
4. This opens the Properties Dialog.
5. Switch to the Security Tab.
6. Under the Security section, make sure the Option SQL Server and Windows is selected.
7. This ensures that your SQL Server is running under Mixed Mode Authentication.
Friday, May 11, 2007
"Timeout expired.
The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached"
"Connection Pooling allows an application to reuse open connection handles, which saves round-trips to the server."
This occurs when you try using more than Max Pool Size connections. By default, the max pool size is 100. If we try to obtain connection more than max pool size, then ADO.NET waits for Connection Timeout for the connection from the pool. If even after that connection is not available, we get the above exception.
Solution(s):
1. Very first step that we should do is – Ensure that every connection that is opened, is Closed explicitly. At times what happens is, we open the connection, performs the desired database operation, but we do not close the connection explicitly. Internally it cannot be used as available valid connection from pool. The application would have to wait for GC to claim it, until then it is not marked as available from pool. In such case, even though you are not using max pool size number of connection simultaneously, you may get this error. This is the most probable cause of this issue.
2. Increase Max Pool Size value to a sufficient Max value. You can do so by including "Max Pool Size = N;" in the connection string, where N is the new Max Pool size.
3. Set the Pooling Off. Well, this indeed is not a good idea as Connection Pooling puts a positive performance effect but it definitely is better that getting any such exceptions.
The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached"
"Connection Pooling allows an application to reuse open connection handles, which saves round-trips to the server."
This occurs when you try using more than Max Pool Size connections. By default, the max pool size is 100. If we try to obtain connection more than max pool size, then ADO.NET waits for Connection Timeout for the connection from the pool. If even after that connection is not available, we get the above exception.
Solution(s):
1. Very first step that we should do is – Ensure that every connection that is opened, is Closed explicitly. At times what happens is, we open the connection, performs the desired database operation, but we do not close the connection explicitly. Internally it cannot be used as available valid connection from pool. The application would have to wait for GC to claim it, until then it is not marked as available from pool. In such case, even though you are not using max pool size number of connection simultaneously, you may get this error. This is the most probable cause of this issue.
2. Increase Max Pool Size value to a sufficient Max value. You can do so by including "Max Pool Size = N;" in the connection string, where N is the new Max Pool size.
3. Set the Pooling Off. Well, this indeed is not a good idea as Connection Pooling puts a positive performance effect but it definitely is better that getting any such exceptions.
Tuesday, April 24, 2007
System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
In web.config write following...
"page enableviewstatemac="False"
In web.config write following...
"page enableviewstatemac="False"
The name 'Request' does not exist in the current context
This error normally occurs when you are trying to access a property such as Request.Cookies and you're not doing that from a webform, usercontrol or a class that inherits from System.Web.UI.You can still access these properties, but using a different path.
For example to access a cookie with the name MyCookie you would normally use Request.Cookies["MyCookie"]; however, if the error The name 'Request' does not exist in the current context is returned, use the following path for retrieving the cookie:
System.Web.HttpContext.Current.Request.Cookies["MyCookie"];
This eror may also occour for "Server" etc..
This error normally occurs when you are trying to access a property such as Request.Cookies and you're not doing that from a webform, usercontrol or a class that inherits from System.Web.UI.You can still access these properties, but using a different path.
For example to access a cookie with the name MyCookie you would normally use Request.Cookies["MyCookie"]; however, if the error The name 'Request' does not exist in the current context is returned, use the following path for retrieving the cookie:
System.Web.HttpContext.Current.Request.Cookies["MyCookie"];
This eror may also occour for "Server" etc..
Subscribe to:
Posts (Atom)