hi i want to import my .xml file to sql server database in asp.net 3.5 c# for windows application.so give m rply as fast as posible.
Sorrry, I am also facing this problem if you got any solution than please inform me
It's not brilliant, but you could read an XML file into a dataset and then use a data adapter to then populate the database...that would require very few lines of code, but not something you'd really want to hold onto...more of a once off dataload.
this might help you http://support.microsoft.com/kb/316005
this code snippet might be helpful
DataSet reportData = new DataSet();
reportData.ReadXml(Server.MapPath(”report.xml”));
SqlConnection connection = new SqlConnection(”CONNECTION STRING”);
SqlBulkCopy sbc = new SqlBulkCopy(connection);
sbc.DestinationTableName = “report_table”;
//if your DB col names don’t match your XML element names 100%
//then relate the source XML elements (1st param) with the destination DB cols
sbc.ColumnMappings.Add(”campaign”, “campaign_id”);
sbc.ColumnMappings.Add(”cost”, “cost_USD”);
connection.Open();
refer http://www.akamarketing.com/blog/135-importing-xml-into-sql-server-table-aspnet.html
first u ve 2 manipulate d xml file using an xml parser, so that the elements in the xml document converts into objects that can be accessed by other applications
If this is something you are doing that is considered to be preprocessing, I would consider using SSIS: Import XML to SQL Server