/* ------------------------ My Meta Content Here SEO ------------------------ */

Pages

Main Menu

Terror of Error

Could not delete from specified tables.
Error: Microsoft JET Database Engine error '80004005' Could not delete from specified tables.

Solution:

This error usually happens when you try to add/update/delete data from the Access database. It means that you don't have sufficient permissions to write to the database. If you are running the web server yourself , you need to setup read/write permissions on the /databases folder on the server. If you are using a web hosting service you will need to contact your provider for instructions. They need to change the permissions on the /databases folder or in some cases setup a system DSN for you.
More Info:
  1. http://learn.iis.net/page.aspx/563/using-classic-asp-with-microsoft-access-databases-on-iis-70-and-iis-75/
  2. http://kb2.adobe.com/cps/153/tn_15376.html
  3. http://www.webwizguide.com/asp/faq/server_permissions.asp

String or binary data would be truncated. the statement has been terminated.

Solution:

So, It might be the Issue with the data type and the size.

Please check if there is anything different between the two column properties that could have caused the issue.



A potentially dangerous Request.Form value was detected from the client

Solution:

Disabling post validation ( validateRequest="false" ) will definitelly avoid this error, but it will leave the page vulnerable to a number of attacks.

Here are possible solution which may help you. Make server side configuration setting for this. If you want to allow HTML element as input from selected pages in your project than you set this page attribute.

@ Page ValidateRequest="false" 

This ValidateRequest="false" on each page. If you want in all pages in you project than make changes in Web.Config file. Add this tag In section.

If you are using .Net 4.0 than you have to make one more change in Web.Config file. Add this tag In section.

httpRuntime requestValidationMode="2.0"

Here are configuration for do not validate request for all pages in .Net 4.0 <system.web> <httpRuntime requestValidationMode="2.0" /> </system.web> <pages validateRequest="false"> </pages> </configuration>



Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

Solution:

Response.Redirect(url,false);

Understand why it is coming ?

If you use the Response.EndResponse.Redirect, or Server.Transfer method, a ThreadAbortException exception occurs. You can use a try-catch statement to catch this exception.

Because: The Response.End method ends the page execution and shifts the execution to the Application_EndRequest event in the application's event pipeline. The line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer methods because both methods call Response.Endinternally.

To work around this problem, use one of the following methods:
  • For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead ofResponse.End to bypass the code execution to the Application_EndRequest event.
  • For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse) that passes false for theendResponse parameter to suppress the internal call to Response.End. For example:
Response.Redirect ("nextpage.aspx", false);
  • If you use this workaround, the code that follows Response.Redirect is executed.
  • For Server.Transfer, use the Server.Execute method instead.

There is also a KB article related to this issue,

Runtime Vs Compile time Errors in C#

Compile time

1. Programmers are human beings and they make mistakes in their code. Even the best programmers make errors.
2. Sometimes these mistakes are simple typos (bad tokens) and sometimes they are caused by a misunderstanding of the language.

Token
A compile time error is one which is detected before the program starts running.

What can go wrong at compile time:
Syntax errors
Typechecking errors
(Rarely) compiler crashes 

int i = "string"; --> error at compile-time

Compile-time errors improve the quality of software. Code that has serious errors is never be allowed to execute. This reduces the possibility that a program that is wrong will be used in an important project.

Run time

An error might only be found in a specific case that occurs while it is running. Or Say
A run time error is one that is only detected when the program runs.

What can go wrong are run-time errors:
Division by zero
Deferencing a null pointer
Running out of memory


Also there can be errors that are detected by the program itself:
Trying to open a file that isn’t there
Trying find a web page and discovering that an alleged URL is not well formed

Hashtable ht = new Hashtable();
ht.Add("key", "string"); // the compiler does not know what is stored in the hashtable // under the key "key" int i = (int)ht["key"]; // --> exception at run-time

Kind of Runtime Error:
An array index is outside the bounds of the array.

Handling update progress before Validation

function ShowProgress() {
    document.getElementById('<% Response.Write(UpdateProgress1.ClientID); %>').style.display =     "inline";
}

function ShowProgressBtn(valgroup) {
    if (Page_ClientValidate(valgroup.toString())) {
    document.getElementById('<% Response.Write(UpdateProgress1.ClientID); %>').style.display =     "inline";
    }
}  

asp:Button ID="btnGo" CssClass="btn1" runat="server" OnClick="btnGo_Click"
                            ValidationGroup="valMobile" Text="Go" OnClientClick="ShowProgressBtn('valMobile');" CausesValidation="false"

On Validation Message Box Popup coming twice 
Resolved

Use Causevalidation to true. it will fire Page.Validate() method. so it will show validation message , and it will validate becouse you call validate () again using Javascript i think you need to Remove javascript validation (Page_ClientValidate).remove this Line.

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.


I would assume that `Servicios` has `DateTime` property which is not being set.

`DateTime`s are not nullable, and when they're not set, they default to `{1/1/0001 12:00:00 AM}`.

Upon calling `db.SubmitChanges()`, you're attempting to insert a value into a `DateTime` column which is a lower value that SQL SERVER supports as seen in your exception.

> SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

this sqltransaction has completed it is no longer usable. c#

You should leave some of the work to compiler, to wrap that in a try/catch/finally for you.
Also, you should expect that Rollback can occasionally throw an exception, if a problem occurs in Commit stage, or if a connection to server breaks. For that reason you should wrap it in a try/catch.
try
{
    transaction.Rollback();
}
catch (Exception ex2)
{
    // This catch block will handle any errors that may have occurred 
    // on the server that would cause the rollback to fail, such as 
    // a closed connection.
    Console.WriteLine("Rollback Exception Type: {0}", ex2.GetType());
    Console.WriteLine("  Message: {0}", ex2.Message);
}
This is copied exactly from MSDN documentation page for Rollback method.

The remote server returned an unexpected response: 

(417) Expectation failed.

System.Net.HttpWebRequest adds the header 'HTTP header "Expect: 100-Continue"' to every request unless you explicitly ask it not to by setting this static property to false:
System.Net.ServicePointManager.Expect100Continue = false;
Some servers choke on that header and send back the 417 error you're seeing.
Give that a shot.

When using WebServices and calling some Web Methods, you may come across this exception:
When Expect 100-Continue property is set to true (this is actually set within part of the .NET Framework, which makes this a difficult problem to overcome. You have to override this in more than one place), this 417 error occurs when the proxy server doesn't support 100-Continue.

In the case of expect 100-Continue, the client will expect to receive a 100-Continue response from the server to indicate that the client should send the data to be posted. This mechanism allows clients to avoid sending large amounts of data over the network when the server, based on the request headers, intends to reject the request.

The Expect 100-Continue behavior is fully described in IETF RFC 2616 Section 10.1.1.
You can also read more about it in MSDN.
To work around this exception, you can do a simple thing: Disable expect 100 continue.
So you may ask how to disable expect 100 continue?
Warning: When you disable Expect 100-Continues and your application sends a large amount of data on the network, if for any reason the server rejects your request, you have to re-send the entire data again, this may cause some extra traffic in your network. Also multiple calls to a server will take longer, since each call will wait until the prior call's response is received.
It is easy. Here are two alternative ways:
  1. We need to have this line of code before making any web requests:
    System.Net.ServicePointManager.Expect100Continue = false; 
  2. Add these lines to the application's configuration file (between <configuration> and </configuration>):
    <system.net>
     <settings>
      <servicePointManager expect100Continue="false" />
     </settings>
    </system.net>
While this workaround is nice, I think a better long term solution is to upgrade/replace the proxy server to handle 100-continue calls.


So far in this short tip, we've learned what is Expect 100, how it is caused and how to workaround this expectation.

Root cause of an “Invalid object name: dbo.etc” error?

First, and without wanting to be condescending, it's clear from your description that you're not comfortable with some of the basic SQL Server concepts around objects, schemas, databases, permissions etc. I would take some time to read up about those, because you're sure to need to the knowledge in future anyway.
Having said that, if I understand correctly, you're executing a procedure (SomeProc) in a database (SomeDB) and it's giving the error Invalid object name 'Informix.dbo.customer'? That simply means that SomeProc cannot find an object called "customer" in a schema called "dbo" in a database called "Informix". There are several possible reasons for this:
  1. The object doesn't exist, possibly because the schema and/or database don't exist
  2. The object exists, but the user running the procedure doesn't have permission to even see it
  3. The object exists, but the database is case-sensitive and some part of the name doesn't match the name in your code
You'll need to investigate more to find out what the cause is in your case, but as a complete guess, your production server has both the Informix and SomeDB databases, but your test server has only SomeDB?
Finally, when posting questions please always include your SQL Server version (2000/2005/2008) and edition (Express, Standard, Enterprise); they can be very important when talking about schemas and permissions, because features and behaviour can be different.

My Blog List