"Inaccessible due to its protection level"

T

Tim Johnson

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
 
T

Tim Wilson

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/d...frlrfsystemdatadatasetclasswritexmltopic8.asp
 
T

Tim Johnson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top