Value was either too large or too small for an Int32

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
drawab
Posts: 46
Joined: Tue Apr 01, 2008 4:57 am

Value was either too large or too small for an Int32

Post by drawab » Sun Oct 04, 2015 4:34 pm

Hi

In an effort to try and get the Database imported into a Google Cloud SQL instance - I run into this Int32 error - im guessing its the telephone number string acting up - but am lost - I tried fixing the database with the Telephone Tool - but it made no difference.

- Google Cloud SQL instance is set to MySQL 5.5
- Have a Windows Server VM instance properly running OD but when I move the SQL database using MySQL Workbench (the only way ive been able to import it without errors)

Code: Select all


************** Exception Text **************
System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at OpenDentBusiness.PIn.Int(String myString)
   at OpenDentBusiness.ReplicationServers.GetServer_id()
   at OpenDentBusiness.ReplicationServers.get_Server_id()
   at OpenDentBusiness.ReplicationServers.GetAtoZpath()
   at OpenDentBusiness.ImageStore.GetPreferredAtoZpath()
   at OpenDental.FormOpenDental.PrefsStartup(Boolean isSilentUpdate)
   at OpenDental.FormOpenDental.FormOpenDental_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Thanks

drawab
Posts: 46
Joined: Tue Apr 01, 2008 4:57 am

Re: Value was either too large or too small for an Int32

Post by drawab » Mon Oct 05, 2015 2:54 am

Update - trying to reverse import from the Google Cloud SQL to my localhost database - OD connects perfectly - so im now guessing its not an OD issue (?) but more or less a Google Cloud SQL configuration issue as OD tries to connect to it

Also in the mean time ive been trying to setup a middle tier server on the Google Cloud VM which is also causing problems up an error - so would appreciate any/all help

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
   at OpenDentBusiness.DataTransferObject.Deserialize(String data)
   at OpenDentBusiness.RemotingClient.ProcessGetDS(DtoGetDS dto)
   at OpenDentBusiness.Meth.GetDS(MethodBase methodBase, Object[] parameters)
   at OpenDentBusiness.Cache.GetCacheDs(String itypesStr)
   at OpenDentBusiness.Cache.RefreshCache(String itypesStr)
   at OpenDental.FormOpenDental.PrefsStartup(Boolean isSilentUpdate)
   at OpenDental.FormOpenDental.FormOpenDental_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Value was either too large or too small for an Int32

Post by jsalmon » Mon Oct 05, 2015 9:11 am

drawab wrote:

Code: Select all


************** Exception Text **************
System.OverflowException: Value was either too large or too small for an Int32.
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at OpenDentBusiness.PIn.Int(String myString)
   at OpenDentBusiness.ReplicationServers.GetServer_id()
   at OpenDentBusiness.ReplicationServers.get_Server_id()
   at OpenDentBusiness.ReplicationServers.GetAtoZpath()
   at OpenDentBusiness.ImageStore.GetPreferredAtoZpath()
   at OpenDental.FormOpenDental.PrefsStartup(Boolean isSilentUpdate)
   at OpenDental.FormOpenDental.FormOpenDental_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I'll submit this as a bug. MySQL stores the server_id as an integer (max value of 4294967295) and we are reading it into C# as an integer (max value of 2147483647) when we should be reading it in as an unsigned int (max value of 4294967295).

https://dev.mysql.com/doc/refman/5.5/en ... tions.html
https://msdn.microsoft.com/en-us/library/296az74e.aspx
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Value was either too large or too small for an Int32

Post by jsalmon » Mon Oct 05, 2015 9:15 am

drawab wrote:Also in the mean time ive been trying to setup a middle tier server on the Google Cloud VM which is also causing problems up an error - so would appreciate any/all help
My guess is that the previous error you posted above is cause the middle tier to fail as well. It is in the same section of code (filling the preferences). Lets see if the bug fix above will help you. Let me know the version of Open Dental you are using please.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

drawab
Posts: 46
Joined: Tue Apr 01, 2008 4:57 am

Re: Value was either too large or too small for an Int32

Post by drawab » Mon Oct 05, 2015 1:25 pm

Thanks for looking into it - ive been using OD 15.2.13.0 for this setup (its a foreign version)

Thank you

User avatar
dgraffeo
Posts: 147
Joined: Wed Sep 24, 2014 3:19 pm

Re: Value was either too large or too small for an Int32

Post by dgraffeo » Thu Oct 08, 2015 10:51 am

Hey there, the issue has been fixed and will be available in versions 15.2.26 and later when they are released.
"To understand what recursion is, you must first understand recursion."

David Graffeo
Open Dental Software
http://www.opendental.com

drawab
Posts: 46
Joined: Tue Apr 01, 2008 4:57 am

Re: Value was either too large or too small for an Int32

Post by drawab » Sat Oct 10, 2015 3:56 am

Thank you - worked like a charm !!

Post Reply