Why do I get this error when I write OPTION STRICT ON? with this code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
XmlSchema11.ReadXml(Application.StartupPath & "\..\Data\GRID.XML", FileMode.Open)
End Sub
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
XmlSchema11.WriteXml(Application.StartupPath & "\..\Data\GRID.XML", FileMode.Open)
End Sub
I get this error:
C:\Documents and Settings\Telemetrika.Com\Desktop\XMLGrid\Form1.vb(111): Overload resolution failed because no accessible 'ReadXml' can be called with these arguments:
'Public Function ReadXml(fileName As String, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
'Public Function ReadXml(reader As System.IO.TextReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Value of type 'String' cannot be converted to 'System.IO.TextReader'.
'Public Function ReadXml(reader As System.IO.TextReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
'Public Function ReadXml(stream As System.IO.Stream, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Value of type 'String' cannot be converted to 'System.IO.Stream'.
'Public Function ReadXml(stream As System.IO.Stream, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
'Public Function ReadXml(reader As System.Xml.XmlReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Value of type 'String' cannot be converted to 'System.Xml.XmlReader'.
'Public Function ReadXml(reader As System.Xml.XmlReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
XmlSchema11.ReadXml(Application.StartupPath & "\..\Data\GRID.XML", FileMode.Open)
End Sub
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
XmlSchema11.WriteXml(Application.StartupPath & "\..\Data\GRID.XML", FileMode.Open)
End Sub
I get this error:
C:\Documents and Settings\Telemetrika.Com\Desktop\XMLGrid\Form1.vb(111): Overload resolution failed because no accessible 'ReadXml' can be called with these arguments:
'Public Function ReadXml(fileName As String, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
'Public Function ReadXml(reader As System.IO.TextReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Value of type 'String' cannot be converted to 'System.IO.TextReader'.
'Public Function ReadXml(reader As System.IO.TextReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
'Public Function ReadXml(stream As System.IO.Stream, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Value of type 'String' cannot be converted to 'System.IO.Stream'.
'Public Function ReadXml(stream As System.IO.Stream, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.
'Public Function ReadXml(reader As System.Xml.XmlReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Value of type 'String' cannot be converted to 'System.Xml.XmlReader'.
'Public Function ReadXml(reader As System.Xml.XmlReader, mode As System.Data.XmlReadMode) As System.Data.XmlReadMode': Option Strict On disallows implicit conversions from 'System.IO.FileMode' to 'System.Data.XmlReadMode'.