K
Kiran
Hi,
I want to back up my data in some table in SQL server and import it back
using Bulk Load of SQL server 2K.
I can use the following code to backup the data in XML
dataset.WriteXml(@"C:\Data.xml");
dataset.WriteXmlSchema(@"C:\Schema1.xml");
and following code to bulk import the same data
SQLXMLBULKLOADLib.SQLXMLBulkLoad3 x = new
SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class();
x.ConnectionString
="PROVIDER=SQLOLEDB.1;SERVER=localhost;UID=sa;PWD=;DATABASE=demo01";
x.XMLFragment = true;
x.ErrorLogFile = @"c:\error.txt";
x.SchemaGen = true;
x.SGDropTables = true;
x.Execute(@"C:\Schema.xml",@"C:\data.xml");
this do not work, but do not thoow any error either, when I looked
closely... the format of the schema file is incorrect, if I create a correct
formate maually it works.
Does some one know how to generate schema file in correct format? using
..Net.
Regards
Kiran
I want to back up my data in some table in SQL server and import it back
using Bulk Load of SQL server 2K.
I can use the following code to backup the data in XML
dataset.WriteXml(@"C:\Data.xml");
dataset.WriteXmlSchema(@"C:\Schema1.xml");
and following code to bulk import the same data
SQLXMLBULKLOADLib.SQLXMLBulkLoad3 x = new
SQLXMLBULKLOADLib.SQLXMLBulkLoad3Class();
x.ConnectionString
="PROVIDER=SQLOLEDB.1;SERVER=localhost;UID=sa;PWD=;DATABASE=demo01";
x.XMLFragment = true;
x.ErrorLogFile = @"c:\error.txt";
x.SchemaGen = true;
x.SGDropTables = true;
x.Execute(@"C:\Schema.xml",@"C:\data.xml");
this do not work, but do not thoow any error either, when I looked
closely... the format of the schema file is incorrect, if I create a correct
formate maually it works.
Does some one know how to generate schema file in correct format? using
..Net.
Regards
Kiran