wpf - Conversion Overflow Error in C# -


I'm getting the error that I'm not able to fix

I have an area where Only numbers are allowed and maximum 10 digits can be entered

Here is the code for digit checking

  char ch = e.Keychar; If (! Four. ISDigit (CA) & CH! = 8 & CH! = 46) {E. Handle = true; }  

But when I try to get this error popup message

Your problem is probably nothing to do with WPF

As you are probably using MS SQL, you can see it.

It says that the maximum possible value for the integer (int, int32) column is 2,147,483,647, while your value is 9999999999, which is more than 2 billion.

You should change the datetime to bigint for columns.

Edit: Also, if your data organizations are created manually, then you should be using the type of SQL + code (long) related to SQL bigint Should be used in type.

Also about WPF

It is possible to handle data validation in code-behind event handling, but the overall drawbacks of WPF's complexity and such approach Due to many problems, I recommend that you take your approval code into view-model classes and use some standard.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -