Hi...
Here iam using sqlBulkCopy to directly import data to sql from XML file...
DataSet EmployeeData = new DataSet();
reportData.ReadXml(Server.MapPath(”Employee.xml”));
SqlConnection connection = new SqlConnection(”CONNECTION STRING”);
SqlBulkCopy sbc = new SqlBulkCopy(connection);
sbc.DestinationTableName = “Employee_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(”EmployeeId”, “Employee_id”);
sbc.ColumnMappings.Add(”Name”, “Name”);
connection.Open();
//table 4 is the main table in this dataset
sbc.WriteToServer(EmployeeData.Tables[0]);
connection.Close();
//remove the xml file
Hop this helps you.....