Groups | Blog | Home
all groups > dotnet compact framework > june 2005 >

dotnet compact framework : "Inaccessible due to its protection level"


Tim Johnson
6/27/2005 3:05:08 PM
This works:

DataSet x = getsomedata();
x.WriteXml("myfile.xml");

This doesn't:

DataSet x = getsomedata();
x.WriteXml("myfile.xml", XmlWriteMode.WriteSchema);

and it refers to the full function in the compiler's error message, as in:

'System.Data.DataSet.WriteXml(string, System.Data.XmlWriteMode)' is
inaccessible due to its protection level

Any ideas why the difference in the 2 calls?

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625


Tim Johnson
6/27/2005 3:31:35 PM
Thanks. It would be nice if there was some clue in Intellisense about it, I
figured since the overload showed up it was supported. Silly me!

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625


[quoted text, click to view]

Tim Wilson
6/27/2005 6:22:29 PM
It appears that the particular overload that you're attempting to use is not
supported (publically) through the CF. The reason why you are seeing that
error message from the compiler is because the overload is actually there,
it's just marked as "internal". However, if you need to use an overload that
takes a XmlWriteMode enum then try using the overload that takes a XmlWriter
(as opposed to a string) as the first parameter.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatasetclasswritexmltopic8.asp

--
Tim Wilson
..Net Compact Framework MVP

[quoted text, click to view]

AddThis Social Bookmark Button