xsd schema file must be annotated in SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class?

删除回忆录丶 提交于 2019-12-11 03:32:15

问题


Here is an example to use SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class -

[STAThread]
   static void Main(string[] args)
   {   
         try
         {
            SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class objBL = new SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();
            objBL.ConnectionString = "Provider=sqloledb;server=server;database=databaseName;integrated security=SSPI";
            objBL.ErrorLogFile = "error.xml";
            objBL.KeepIdentity = false;
            objBL.Execute ("schema.xml","data.xml");
         }
         catch(Exception e)
         {
         Console.WriteLine(e.ToString());
         }
   }

It seems that schema.xml must be annotated with sql information to make importing successful. Regular xsd file does not work.

Is there any tools or ways to automate the generation of annotate information basing on xsd file? I could not find any through Internet Search. I wonder how SSIS can achieve this. Is there any component doing this so I can include it in my .NET application?


回答1:


Unfortunately I don't believe there is, you have to add these things manually, as far as I'm aware. The upside is that it isn't too difficult, though, providing you don't hit any weird hiccups.

If you post your XSD and table structure maybe I can give you a hand.



来源:https://stackoverflow.com/questions/4039085/xsd-schema-file-must-be-annotated-in-sqlxmlbulkloadlib-sqlxmlbulkload4class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!