Click here to Skip to main content
15,943,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to read XML file(just like file browser in and store the value in the temp table(LINQ is an optional). Since I am new to desktop application codes are highly appreciable.
Thank you in ADvance.
Updated 9-Sep-12 19:52pm
Kuthuparakkal 10-Sep-12 2:06am    
what do you mean by temp table ? SQL ? Oracle ? MySQL ?
Purushottam Prajapati 10-Sep-12 2:09am    
SQL (temporary table : just to hold data for use)

Hi Purushottam hope this wil help full,

//creating a data table to store      
  DataTable dt = new DataTable();

//give the path of the xml file or name if it is in current directory

//dt is the table holding values set from the xml now we can write it to 
//the sql database

string strConnectionString = @"Data Source=xyzYY\SQLEXPRESS;Initial Catalog=TrackerDB;User ID=admin;Password=wxyz;"; 
               SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnectionString);sqlBulk.DestinationTableName = "dbo.Quote_Staging"; sqlBulk.WriteToServer(dt);
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900