Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
bind xml file data into datatable
November 08, 2008
This ok to bind xml file data into datatable. but now how this datatable will bind with sql where we not now that in xml how much column is present or how much row is ableble in xml data.
have u know any solution about it.
i have practice about it, i find that, using Backbulkcopy method where its one properties like backbulkcopy.destinationtablename="";
in this properties we want to auto create table and its column accourding to xml data column.
please have u any suggestion about it.........!
Posted Date: November 08, 2008 Points: 5
ok..So why dont you create table first using SQL "Create Table..." the assign the table name
backbulkcopy.destinationtablename="Your table name".
1) Load XML into DataSet using ReadXml method eg ds.ReadXml(xMLfilePath);
2) Get Table name from dataset like this ds.Tables.TableName or you can assign your own table name
3) Get Column name from dataset tables like thisds.Tables.Columns which will return you column collection .the you can loop this collection and get the column name like this ds.Tables.Columns.ColumnName.
4) then now you have Table name and column name you can create Tables using SQL Query then
5) Using BulkCopy you can save the xml data into Table.
Hope this will help you.
Mark As Answer
" if this post help you.
To post reply
Related Questions Related Questions
how to show data from xml file in GridView
How to export datagridview data to excel file
Bind xml file into GridView
bind data''s with the textboxes from db on page_load
exporting form data to a pdf file when user click on the save button
Bind data from database to array
How to read the data from the xml file
how to copy data tiff file into Doc using c#
email html form data in text file
Xml data bind to msmq wcf
Latest Forum Questions From The Same Category
database is read-only.
editor for visual basic with c#.net
How to get phone number in .Net windows application?
while accessing method from proxy giving an unauthorized access
How to make search between two dates accept null not obligatory search proplem
Create a Windows form application using Excel as database..
Recieve Data From Serial Com Port C# In One Line And Convert To integer
display parent data and child data as a row group in one datagridview using c# winform
enter key event in windows app c#.net
windows appplication c#.net
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend