IzzyTwinkly
asked on
Where is my xml file stored at?
Hi,
My understanding is that the following two lines of code will store the result as files. Where are these files created at after I executed the whole code?
ds.WriteXmlSchema("dscSche ma.xsd");
ds.WriteXml("dsc.xml");
using System;
using System.Data;
using System.Data.SqlClient;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string conStr = "Server=localhost; user id=sa; password=; database=northwind";
SqlConnection conn = new SqlConnection(conStr);
conn.Open();
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand("select * from Address", conn);
DataSet ds = new DataSet();
adapter.Fill(ds);
conn.Close();
string dsXmlSc = ds.GetXmlSchema();
string dsXml = ds.GetXml();
Console.WriteLine("------- -----XML Schema-------------");
Console.WriteLine(dsXmlSc) ;
Console.WriteLine("------- -Print out as XML-----------");
Console.WriteLine(dsXml);
ds.WriteXmlSchema("dscSche ma.xsd");
ds.WriteXml("dsc.xml");
Console.Read();
}// main
}// class
}
My understanding is that the following two lines of code will store the result as files. Where are these files created at after I executed the whole code?
ds.WriteXmlSchema("dscSche
ds.WriteXml("dsc.xml");
using System;
using System.Data;
using System.Data.SqlClient;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string conStr = "Server=localhost; user id=sa; password=; database=northwind";
SqlConnection conn = new SqlConnection(conStr);
conn.Open();
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = new SqlCommand("select * from Address", conn);
DataSet ds = new DataSet();
adapter.Fill(ds);
conn.Close();
string dsXmlSc = ds.GetXmlSchema();
string dsXml = ds.GetXml();
Console.WriteLine("-------
Console.WriteLine(dsXmlSc)
Console.WriteLine("-------
Console.WriteLine(dsXml);
ds.WriteXmlSchema("dscSche
ds.WriteXml("dsc.xml");
Console.Read();
}// main
}// class
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or the location where the exe is installed