warning XS9043: NamedType 'Exception' is ambiguous.

This forum is meant for questions and discussions about the X# language and tools
Post Reply
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

warning XS9043: NamedType 'Exception' is ambiguous.

Post by rn@warner-it.com »

H Chris,
First of all thank all of you for your help so far in this forum even if the problem is not completely solved at least the ideas that one gets helps a lot to find solutions even a work around..

Chris or anyone
Can you please help on this it use to work in vulcan.net but the same code does not seem to be ok for X#

Thanks
Raymond
error XS1061: 'Microsoft.Office.Interop.Outlook.Exception' does not contain a definition for 'Message' and no accessible extension method 'Message' accepting a first argument of type 'Microsoft.Office.Interop.Outlook.Exception' could be found (are you missing a using directive or an assembly reference?) 788,8 F3WE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSales' 798,5 F3WE.prg StartStopV2
warning XS9043: NamedType 'Exception' is ambiguous. Could be 'Microsoft.Office.Interop.Outlook.Exception' or 'System.Exception'. Using the first one. 826,7 F3WE.prg StartStopV2
error XS0155: The type caught or thrown must be derived from System.Exception 826,7 F3WE.prg StartStopV2
error XS1061: 'Microsoft.Office.Interop.Outlook.Exception' does not contain a definition for 'Message' and no accessible extension method 'Message' accepting a first argument of type 'Microsoft.Office.Interop.Outlook.Exception' could be found (are you missing a using directive or an assembly reference?) 830,8 F3WE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSales' 840,5 F3WE.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 680,2 LoadWinB.prg StartStopV2
warning XS9043: NamedType 'exception' is ambiguous. Could be 'Microsoft.Office.Interop.Outlook.Exception' or 'System.Exception'. Using the first one. 901,1 F3WE.prg StartStopV2
error XS0155: The type caught or thrown must be derived from System.Exception 901,1 F3WE.prg StartStopV2
error XS1061: 'Microsoft.Office.Interop.Outlook.Exception' does not contain a definition for 'Message' and no accessible extension method 'Message' accepting a first argument of type 'Microsoft.Office.Interop.Outlook.Exception' could be found (are you missing a using directive or an assembly reference?) 934,2 F3WE.prg StartStopV2

METHOD btUpdateClick(sender AS System.Object , e AS System.EventArgs) AS System.Void
LOCAL cGRNumber AS STRING


TRY
// SELF:bs:EndEdit() // WICHTIG bei Verwendung von BindingSource, sonst werden die Änderungen NICHT weggeschrieben!
// Werte aus den Textboxen in die Felder der DataRow
* cTicketNr := SELF:CurrentRow:Item["Todokey"]:ToString():Trim()

SELF:CurrentRow:Item["GRperson"] := SELF:oCBWHPerson:Text:Trim()
SELF:CurrentRow:Item["Supplier"] := SELF:oTBSupplier:Text:Trim()
SELF:CurrentRow:Item["Quantity"] := SELF:oTBQuantity:Text:Trim()
SELF:CurrentRow:Item["ItemDesc"] := SELF:oTBItemDesc:Text:Trim()
SELF:CurrentRow:Item["GRDate"] := SELF:oDateTimePicker1:Value:ToShortDateString()
SELF:CurrentRow:Item["Subject"] := SELF:oTBSubject:Text:Trim()
SELF:CurrentRow:Item["Forwardto"] := SELF:oCBPerson:Text:Trim()
SELF:CurrentRow:Item["Comments"] := SELF:oTBInfo:Text:Trim()
SELF:CurrentRow:Item["Stats"] := SELF:oCBStatus:Text:Trim()
SELF:CurrentRow:Item["CloseDate"] := SELF:oDateTimePicker2:Value:ToShortDateString()


// hier in die weiteren Felder schreiben: normalerweise bei Feldern vom typ STRING die TEXT-Property verwenden - auch bei ComboBoxen



SELF:dt:GetChanges() // Same as Commit in vo // DT means DataTable is memory image of Table
SELF:cmdBuilder:GetUpdateCommand() // cmdBuilder generates SQl commands for updating based on Select statement
SELF:da:Update(SELF:ds,"GR_Warehouse") // Update Physically updates the File // DA means DataAdapter is Oledbprovider to connect to Table

messagebox.show("Update für GRNumber "+cGRNumber+" OK!")

SELF:close() // Wichtig!!! Wenn das Fenster NICHT geschlossen wird, wird die GridView NICHT aktualisiert!!!!

/// RealOwner wird als zweiter Param. vom aufrufenden CellDoubleClick übergeben
SELF:RealOwner:GetChanges(SELF:nCurrentPos, FALSE) // FALSE = Update mode ; zwingt die DGV die Änderungen anzuzeigen

CATCH ex AS exception
messageBox.show("Update Fehgeschlagen! "+ex:Message:ToString())
END TRY

RETURN

warning XS9043: NamedType 'Datatable' is ambiguous. Could be 'System.Data.DataTable' or 'Microsoft.Office.Interop.Excel.DataTable'. Using the first one. 120,2 LoadWinAE.prg StartStopV2
warning XS9043: NamedType 'DataTable' is ambiguous. Could be 'System.Data.DataTable' or 'Microsoft.Office.Interop.Excel.DataTable'. Using the first one. 125,2 LoadWinAE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'nPrintCol' 292,4 PrintDocument.prg StartStopV2
warning XS0165: Use of unassigned local variable 'j' 488,18 PrintDocument.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 843,2 DrillWin4.prg StartStopV2
warning XS0165: Use of unassigned local variable 'dgv' 906,2 DrillWin4.prg StartStopV2
warning XS0165: Use of unassigned local variable 'dgv' 960,2 DrillWin4.prg StartStopV2
[b]warning XS9043: NamedType 'Exception' is ambiguous. Could be 'Microsoft.Office.Interop.Outlook.Exception' or 'System.Exception'. Using the first one. 784,7 F3WE.prg StartStopV2
error XS0155: The type caught or thrown must be derived from System.Exception 784,7 F3WE.prg [/b]StartStopV2
error XS1061: 'Microsoft.Office.Interop.Outlook.Exception' does not contain a definition for 'Message' and no accessible extension method 'Message' accepting a first argument of type 'Microsoft.Office.Interop.Outlook.Exception' could be found (are you missing a using directive or an assembly reference?) 788,8 F3WE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSales' 798,5 F3WE.prg StartStopV2
warning XS9043: NamedType 'Exception' is ambiguous. Could be 'Microsoft.Office.Interop.Outlook.Exception' or 'System.Exception'. Using the first one. 826,7 F3WE.prg StartStopV2
error XS0155: The type caught or thrown must be derived from System.Exception 826,7 F3WE.prg StartStopV2
error XS1061: 'Microsoft.Office.Interop.Outlook.Exception' does not contain a definition for 'Message' and no accessible extension method 'Message' accepting a first argument of type 'Microsoft.Office.Interop.Outlook.Exception' could be found (are you missing a using directive or an assembly reference?) 830,8 F3WE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSales' 840,5 F3WE.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 680,2 LoadWinB.prg StartStopV2
warning XS9043: NamedType 'exception' is ambiguous. Could be 'Microsoft.Office.Interop.Outlook.Exception' or 'System.Exception'. Using the first one. 901,1 F3WE.prg StartStopV2
error XS0155: The type caught or thrown must be derived from System.Exception 901,1 F3WE.prg StartStopV2
error XS1061: 'Microsoft.Office.Interop.Outlook.Exception' does not contain a definition for 'Message' and no accessible extension method 'Message' accepting a first argument of type 'Microsoft.Office.Interop.Outlook.Exception' could be found (are you missing a using directive or an assembly reference?) 934,2 F3WE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cGRNumber' 926,2 F3WE.prg StartStopV2
warning XS0165: Use of unassigned local variable 'dgv' 766,2 LoadWinB.prg StartStopV2
warning XS0165: Use of unassigned local variable 'dgv' 820,2 LoadWinB.prg StartStopV2
warning XS0162: Unreachable code detected 905,1 Form1.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 1028,2 DrillWin.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 859,2 DrillWin3.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSelect' 940,8 DrillWin3.prg StartStopV2
warning XS0165: Use of unassigned local variable 'dgv' 1093,2 DrillWin3.prg StartStopV2
warning XS0165: Use of unassigned local variable 'dgv' 1147,2 DrillWin3.prg StartStopV2
warning XS0165: Use of unassigned local variable 'oWin2' 239,8 SmallWin.prg StartStopV2
warning XS0165: Use of unassigned local variable 'TempYear' 703,5 ServiceWinA.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 325,2 SmallWin.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cOrdHdr' 921,5 ServiceWinA.prg StartStopV2
warning XS0165: Use of unassigned local variable 'oDuration1' 2448,8 StopWatch.prg StartStopV2
warning XS0165: Use of unassigned local variable 'abt' 1123,4 Frm_BITreeview.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSpan' 2567,8 StopWatch.prg StartStopV2
warning XS0252: Possible unintended reference comparison; to get a value comparison, cast the left hand side to type 'string' 1280,2 Frm_BITreeview.prg StartStopV2
warning XS0165: Use of unassigned local variable 'CSpan' 3035,8 StopWatch.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSpan' 3099,8 StopWatch.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSpan' 3162,8 StopWatch.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSpan' 3225,8 StopWatch.prg StartStopV2
warning XS0165: Use of unassigned local variable 'cSpan' 3321,8 StopWatch.prg StartStopV2
warning XS0165: Use of unassigned local vari
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

warning XS9043: NamedType 'Exception' is ambiguous.

Post by ic2 »

Hello,

If you find errors like NamedType 'Exception' is ambiguous it means that, in this case, Exception can be found in more than one namespace. It now looks into Outlook which is not what you meant.

Change this:

CATCH ex AS System.Exception

and see if it helps completely.

Dick
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

warning XS9043: NamedType 'Exception' is ambiguous.

Post by rn@warner-it.com »

I am afraid your suggestion did not work I just tried it here is the result

error XS9002: Parser: unexpected input 'ex AS System exception' 535,21 F3WE.prg StartStopV2
error XS9002: Parser: unexpected input 'System exception' 535,21 F3WE.prg StartStopV2
error XS9002: Parser: unexpected input 'exception' expecting EOS 535,21 F3WE.prg StartStopV2
error XS9002: Parser: mismatched input '.' expecting EOS 536,12 F3WE.prg StartStopV2
error XS9002: Parser: mismatched input '(' expecting EOS 536,17 F3WE.prg StartStopV2
error XS9002: Parser: mismatched input ':' expecting EOS 536,52 F3WE.prg StartStopV2
error XS9002: Parser: mismatched input ':' expecting EOS 536,60 F3WE.prg StartStopV2
error XS9002: Parser: mismatched input '(' expecting EOS 536,69 F3WE.prg StartStopV2
error XS1003: Syntax error, 'END [TRY]' expected 535,2 F3WE.prg StartStopV2
Compilation failed (9 errors)
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

warning XS9043: NamedType 'Exception' is ambiguous.

Post by Chris »

Hi Raymond,

You missed a dot between System and Exception:

System.Exception
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

warning XS9043: NamedType 'Exception' is ambiguous.

Post by ic2 »

Also the message is in the Welcome group. I noticed myself that I always need to check which forum is selected.

Maybe someone can change the forum and the subject ;)

Dick
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

warning XS9043: NamedType 'Exception' is ambiguous.

Post by Chris »

Hi Dick,

Done :)
And thanks for your prompt reply to Raymond!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
rn@warner-it.com
Posts: 46
Joined: Mon Mar 04, 2019 4:41 pm

warning XS9043: NamedType 'Exception' is ambiguous.

Post by rn@warner-it.com »

Hi Chris and Dick,
Thanks a lot for the help I did miss the dot and Dick the changes you suggested do work.

Thanks a Lot for you r Help

Regards,
Raymond
Post Reply