How can we help you today? How can we help you today?

Exception: The type initializer for "_40" threw an exception

Just installed it and chose "Launch..." from the Finished dialog...

I had PromptSQL v1.4 installed and running when the install began. I exited it and closed the session that was connecting to my DB as the install stalled. It completed OK after that.

I get the exception when I right-click the tray icon and try to get to the Options dialog.

************** Exception Text **************
System.TypeInitializationException: The type initializer for "_40" threw an exception. ---> System.ArithmeticException: Overflow or underflow in the arithmetic operation.
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet)
at _40._1()
at _40..ctor()
at _40..cctor()
--- End of inner exception stack trace ---
at _40._2()
at _47._4()
at _47._8(Object , EventArgs )
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(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.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
RedGate.SQLPrompt
Assembly Version: 2.0.0.59
Win32 Version: 2.0.0.59
CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt/RedGate.SQLPrompt.exe
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
RedGate.SQL.Shared
Assembly Version: 5.2.0.2
Win32 Version: 5.2.0.2
CodeBase: file:///C:/Program%20Files/Red%20Gate/SQL%20Prompt/RedGate.SQL.Shared.DLL
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
PDinCA
0

Comments

6 comments

  • Neil Davidson
    Hi,

    Can you open up the options file (C:\Documents and Settings\username\Local Settings\Application Data\Red Gate\SQL Prompt\Options.xml) and see what value the <fontsize/> is please.
    Neil Davidson
    0
  • PDinCA
    <?xml version="1.0" encoding="utf-16" standalone="yes" ?>
    - <!-- SQL Prompt
    SQL Prompt
    Version:2.0.0.26
    -->
    - <Options version="2" type="SQLPromptOptions">
    <SQLPromptActive>True</SQLPromptActive>
    <ListDatabasesInAll>False</ListDatabasesInAll>
    <ListOwnersInAll>False</ListOwnersInAll>
    <ShowSS2000SystemObjects>False</ShowSS2000SystemObjects>
    <ShowSS2005SystemObjects>False</ShowSS2005SystemObjects>
    <JoinOnNames>True</JoinOnNames>
    <ShowBuiltInFunctions>True</ShowBuiltInFunctions>
    <ShowConfigurationFunctions>False</ShowConfigurationFunctions>
    <ShowCursorFunctions>False</ShowCursorFunctions>
    <ShowDateTimeFunctions>True</ShowDateTimeFunctions>
    <ShowMathFunctions>False</ShowMathFunctions>
    <ShowMetaDataFunctions>False</ShowMetaDataFunctions>
    <ShowSecurityFunctions>False</ShowSecurityFunctions>
    <ShowStringFunctions>True</ShowStringFunctions>
    <ShowSystemFunctions>False</ShowSystemFunctions>
    <ShowSystemStatisticalFunctions>False</ShowSystemStatisticalFunctions>
    <ShowTextImageFunctions>False</ShowTextImageFunctions>
    <ShowAggregateFunctions>True</ShowAggregateFunctions>
    <ShowRowsetFunctions>False</ShowRowsetFunctions>
    <PrefixTablesWithOwner>False</PrefixTablesWithOwner>
    <PrefixTablesWithOwnerInYukon>False</PrefixTablesWithOwnerInYukon>
    <PrefixTablesWithDatabase>False</PrefixTablesWithDatabase>
    <QuoteDBObjects>False</QuoteDBObjects>
    <DisplayToolTips>True</DisplayToolTips>
    <FontFamily>Courier New</FontFamily>
    <FontSize>10</FontSize>
    <ListColumnsInActualOrder>True</ListColumnsInActualOrder>
    <IgnoreDatabases>False</IgnoreDatabases>
    <DatabasesToIgnore type="ArrayList" version="1" />
    - <Snippets type="ArrayList" version="1">
    - <value version="1" type="Snippet">
    <Shortcut>ssf</Shortcut>
    <Code>SELECT * FROM</Code>
    </value>
    - <value version="1" type="Snippet">
    <Shortcut>w2</Shortcut>
    <Code>sp_who2+^{LEFT}{F5}</Code>
    </value>
    </Snippets>
    <AutoUppercase>False</AutoUppercase>
    - <UppercaseKeywords type="ArrayList" version="1">
    <value type="string">ADD</value>
    <value type="string">ALL</value>
    <value type="string">ALTER</value>
    <value type="string">AND</value>
    <value type="string">ANY</value>
    <value type="string">AS</value>
    <value type="string">ASC</value>
    <value type="string">AUTHORIZATION</value>
    <value type="string">BACKUP</value>
    <value type="string">BEGIN</value>
    <value type="string">BETWEEN</value>
    <value type="string">BREAK</value>
    <value type="string">BROWSE</value>
    <value type="string">BULK</value>
    <value type="string">BY</value>
    <value type="string">CASCADE</value>
    <value type="string">CASE</value>
    <value type="string">CHECK</value>
    <value type="string">CHECKPOINT</value>
    <value type="string">CLOSE</value>
    <value type="string">CLUSTERED</value>
    <value type="string">COALESCE</value>
    <value type="string">COLLATE</value>
    <value type="string">COLUMN</value>
    <value type="string">COMMIT</value>
    <value type="string">COMPUTE</value>
    <value type="string">CONSTRAINT</value>
    <value type="string">CONTAINS</value>
    <value type="string">CONTAINSTABLE</value>
    <value type="string">CONTINUE</value>
    <value type="string">CONVERT</value>
    <value type="string">CREATE</value>
    <value type="string">CROSS</value>
    <value type="string">CURRENT</value>
    <value type="string">CURRENT_DATE</value>
    <value type="string">CURRENT_TIME</value>
    <value type="string">CURRENT_TIMESTAMP</value>
    <value type="string">CURRENT_USER</value>
    <value type="string">CURSOR</value>
    <value type="string">DATABASE</value>
    <value type="string">DBCC</value>
    <value type="string">DEALLOCATE</value>
    <value type="string">DECLARE</value>
    <value type="string">DEFAULT</value>
    <value type="string">DELETE</value>
    <value type="string">DENY</value>
    <value type="string">DESC</value>
    <value type="string">DISK</value>
    <value type="string">DISTINCT</value>
    <value type="string">DISTRIBUTED</value>
    <value type="string">DOUBLE</value>
    <value type="string">DROP</value>
    <value type="string">DUMMY</value>
    <value type="string">DUMP</value>
    <value type="string">ELSE</value>
    <value type="string">END</value>
    <value type="string">ERRLVL</value>
    <value type="string">ESCAPE</value>
    <value type="string">EXCEPT</value>
    <value type="string">EXEC</value>
    <value type="string">EXECUTE</value>
    <value type="string">EXISTS</value>
    <value type="string">EXIT</value>
    <value type="string">FETCH</value>
    <value type="string">FILE</value>
    <value type="string">FILLFACTOR</value>
    <value type="string">FOR</value>
    <value type="string">FOREIGN</value>
    <value type="string">FREETEXT</value>
    <value type="string">FREETEXTTABLE</value>
    <value type="string">FROM</value>
    <value type="string">FULL</value>
    <value type="string">FUNCTION</value>
    <value type="string">GOTO</value>
    <value type="string">GRANT</value>
    <value type="string">GROUP</value>
    <value type="string">HAVING</value>
    <value type="string">HOLDLOCK</value>
    <value type="string">IDENTITY</value>
    <value type="string">IDENTITY_INSERT</value>
    <value type="string">IDENTITYCOL</value>
    <value type="string">IF</value>
    <value type="string">IN</value>
    <value type="string">INDEX</value>
    <value type="string">INNER</value>
    <value type="string">INSERT</value>
    <value type="string">INTERSECT</value>
    <value type="string">INTO</value>
    <value type="string">IS</value>
    <value type="string">JOIN</value>
    <value type="string">KEY</value>
    <value type="string">KILL</value>
    <value type="string">LEFT</value>
    <value type="string">LIKE</value>
    <value type="string">LINENO</value>
    <value type="string">LOAD</value>
    <value type="string">NATIONAL</value>
    <value type="string">NOCHECK</value>
    <value type="string">NONCLUSTERED</value>
    <value type="string">NOT</value>
    <value type="string">NULL</value>
    <value type="string">NULLIF</value>
    <value type="string">OF</value>
    <value type="string">OFF</value>
    <value type="string">OFFSETS</value>
    <value type="string">ON</value>
    <value type="string">OPEN</value>
    <value type="string">OPENDATASOURCE</value>
    <value type="string">OPENQUERY</value>
    <value type="string">OPENROWSET</value>
    <value type="string">OPENXML</value>
    <value type="string">OPTION</value>
    <value type="string">OR</value>
    <value type="string">ORDER</value>
    <value type="string">OUTER</value>
    <value type="string">OVER</value>
    <value type="string">PERCENT</value>
    <value type="string">PLAN</value>
    <value type="string">PRECISION</value>
    <value type="string">PRIMARY</value>
    <value type="string">PRINT</value>
    <value type="string">PROC</value>
    <value type="string">PROCEDURE</value>
    <value type="string">PUBLIC</value>
    <value type="string">RAISERROR</value>
    <value type="string">READ</value>
    <value type="string">READTEXT</value>
    <value type="string">RECONFIGURE</value>
    <value type="string">REFERENCES</value>
    <value type="string">REPLICATION</value>
    <value type="string">RESTORE</value>
    <value type="string">RESTRICT</value>
    <value type="string">RETURN</value>
    <value type="string">REVOKE</value>
    <value type="string">RIGHT</value>
    <value type="string">ROLLBACK</value>
    <value type="string">ROWCOUNT</value>
    <value type="string">ROWGUIDCOL</value>
    <value type="string">RULE</value>
    <value type="string">SAVE</value>
    <value type="string">SCHEMA</value>
    <value type="string">SELECT</value>
    <value type="string">SESSION_USER</value>
    <value type="string">SET</value>
    <value type="string">SETUSER</value>
    <value type="string">SHUTDOWN</value>
    <value type="string">SOME</value>
    <value type="string">STATISTICS</value>
    <value type="string">SYSTEM_USER</value>
    <value type="string">TABLE</value>
    <value type="string">TEXTSIZE</value>
    <value type="string">THEN</value>
    <value type="string">TO</value>
    <value type="string">TOP</value>
    <value type="string">TRAN</value>
    <value type="string">TRANSACTION</value>
    <value type="string">TRIGGER</value>
    <value type="string">TRUNCATE</value>
    <value type="string">TSEQUAL</value>
    <value type="string">UNION</value>
    <value type="string">UNIQUE</value>
    <value type="string">UPDATE</value>
    <value type="string">UPDATETEXT</value>
    <value type="string">USE</value>
    <value type="string">USER</value>
    <value type="string">VALUES</value>
    <value type="string">VARYING</value>
    <value type="string">VIEW</value>
    <value type="string">WAITFOR</value>
    <value type="string">WHEN</value>
    <value type="string">WHERE</value>
    <value type="string">WHILE</value>
    <value type="string">WITH</value>
    <value type="string">WRITETEXT</value>
    </UppercaseKeywords>
    <AutoEnterOnOne>False</AutoEnterOnOne>
    <ShowPopupAfterSpace>True</ShowPopupAfterSpace>
    - <AutoPopupWords type="ArrayList" version="1">
    <value type="string">AND</value>
    <value type="string">BY</value>
    <value type="string">EXEC</value>
    <value type="string">EXECUTE</value>
    <value type="string">FROM</value>
    <value type="string">INTO</value>
    <value type="string">JOIN</value>
    <value type="string">ON</value>
    <value type="string">OR</value>
    <value type="string">UPDATE</value>
    <value type="string">USE</value>
    <value type="string">WHERE</value>
    </AutoPopupWords>
    <ShareCredentialsPerServer>False</ShareCredentialsPerServer>
    <AlwaysPromptForAuthentication>False</AlwaysPromptForAuthentication>
    <EnableInQA>True</EnableInQA>
    <EnableInEntMgr>True</EnableInEntMgr>
    <EnableInSSMS>True</EnableInSSMS>
    <EnableInVS2003>True</EnableInVS2003>
    <EnableInVS2005>True</EnableInVS2005>
    - <VisualStudioExtensions type="ArrayList" version="1">
    <value type="string">.sql</value>
    </VisualStudioExtensions>
    <EnableInUltraEdit>False</EnableInUltraEdit>
    - <UltraEditExtensions type="ArrayList" version="1">
    <value type="string">.sql</value>
    </UltraEditExtensions>
    <EnableInEditPlus2>False</EnableInEditPlus2>
    - <EditPlus2Extensions type="ArrayList" version="1">
    <value type="string">.sql</value>
    </EditPlus2Extensions>
    <EditPlus2TabStops>8</EditPlus2TabStops>
    <SavedConnections type="Hashtable" version="1" />
    <MaxRowsWhenGettingAllObjects>5000</MaxRowsWhenGettingAllObjects>
    <AfterDotDelay>200</AfterDotDelay>
    <AsteriskExpansionSeparator>,</AsteriskExpansionSeparator>
    <ConnectionCheck>10</ConnectionCheck>
    <ConnectionTimeout>10</ConnectionTimeout>
    <DisplayIcons>True</DisplayIcons>
    <ListBoxColor>-16777216</ListBoxColor>
    <ListBoxItemCount>12</ListBoxItemCount>
    <ListBoxLoop>False</ListBoxLoop>
    <PopupMaxWidth>300</PopupMaxWidth>
    <PruneListBox>True</PruneListBox>
    <SaveCacheToDisk>True</SaveCacheToDisk>
    <ToolTipDelay>300</ToolTipDelay>
    <ToolTipColor>-16777216</ToolTipColor>
    </Options>
    PDinCA
    0
  • PDinCA
    As I couldn't get to 2.0, I uninstalled it and reinstalled v1.4. When I went to the Options dialog, I noticed that the point size for both fonts was showing 9.75pt. When I went to "Change..." the fonts, they show as 10pt - as I had set them way back... I changed them to 9pt and they stay at 9pt.

    I have an Explorer Trackball and when in IE6 I hold down the Ctrl key and scroll the wheel, the font size is enlarged or reduced. I only bumped into this by accident a few weeks ago and it seems coincident with the exceptions I've been experiencing with all Red-Gate Products since then. Could that have any relevance, i.e., is there some "font scaling" going on in the background that's affecting RG's Products?
    PDinCA
    0
  • Bart Read
    PDinCA wrote:
    As I couldn't get to 2.0, I uninstalled it and reinstalled v1.4. When I went to the Options dialog, I noticed that the point size for both fonts was showing 9.75pt. When I went to "Change..." the fonts, they show as 10pt - as I had set them way back... I changed them to 9pt and they stay at 9pt.

    I have an Explorer Trackball and when in IE6 I hold down the Ctrl key and scroll the wheel, the font size is enlarged or reduced. I only bumped into this by accident a few weeks ago and it seems coincident with the exceptions I've been experiencing with all Red-Gate Products since then. Could that have any relevance, i.e., is there some "font scaling" going on in the background that's affecting RG's Products?

    Hi there,


    It's interesting you mention this happens with other Red Gate products because I'm pretty certain we experienced a similar issue with SQL Dependency Tracker, and it turned out to be something to do with .NET/GDI+, however I'm also pretty certain we found a workaround for it. I'll have a chat with my colleague Dan Archer when he gets in and get back to you later today.


    Thanks,
    Bart Read
    0
  • Bart Read
    Sorry, I just realised I hadn't posted anything else about this. It turns out that I was correct in my original assertion. The problem is due to an unexpected modification of the floating point control register during font initialisation, which isn't handled particularly gracefully by .NET. The fix is even more ugly... you have to catch the exception and retry the operation. Bleuch!

    We'll make sure this is fixed in version 3, however it's so rare that I wonder if you'd please consider registering for our 3.0 beta program which you can find details of here:

    http://www.red-gate.com/MessageBoard/vi ... php?t=2567

    This will allow us to test that it is in fact fixed, as we've never been able to reproduce it here, although as I said before we had exactly the same issue with SQL Dependency Tracker and have applied a patch for it in the upcoming 2.1 point release.


    Many thanks,
    Bart Read
    0
  • PDinCA
    Email duly sent. Glad to help out, especially if it results in a usable version that's better than 1.4.

    Cheers!
    PDinCA
    0

Add comment

Please sign in to leave a comment.