The question is a result of totally broken logic. Suppose a compiler tells you "cannot convert type A into type B". It is very illogical to use this fact to ask a question "OK, and how can I convert A into B?". Just the opposite, it's most likely the indication that using the type A where type B is expected simply makes no sense.
Take a question about "conversion" of a string into a
DataSet
. It makes no sense. Generally string is a string, it is not "converted" into anything except may be another object which is a different technical representation of the idea of string, such as null-terminated string or something else.
Even though in same cases a string can represent a Dataset, but there is no such operation as "conversion". It can be
serialization of some object or object graph into a string in some format, for example, based on XML or JSON, which
deserialization used to re-create an object or an object graph equivalent to original one. It could be
parsing of such format. Whatever it is, it cannot be called "conversion".
In your code sample, your
DataSet
probably has no current schema you are trying to right. In this case you cannot right anything, according to
http://msdn.microsoft.com/en-us/library/system.data.xmlwritemode.aspx[
^].
It is not clear to me where your exception comes from, as you did not clearly indicate what did you face with: an exception or compilation error, what was exact message, line of code and other relevant information. You should always provide such information in a comprehensive way when asking questions.
—SA