Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have many xml files.that should be display in datagridview.
After displaying each xml file at a time ,it should be saved in its respective sql table on one button click.

Flow is:

1)open dialog box, select any xml file.
2)show in datagridview on show buttonclick.
3)this datagridview data should be enter in sql table on save buttonclick
Posted
Comments
Wendelius 18-Feb-15 1:09am    
So far you have just defined the requirement. What have you done, where are you stuck at?

1) Look here[^] to open the file and here[^] to read the file.

2) Unclear. If you want to show the xml, a datagrid is not really what you want, except if you'd like to parse it, in which case you'll need to write a lot of business logic. Are users allowed to change contents? and if so, does the file need to be saved again as well?

3) Unclear. Do you want to save the xml as text in one column or do you want to parse the xml (like nr. 2) and store the values in a structured way into the database? Another option is to save the file under a root folder and save the path of the file in the database.

If the xml has always the same structure I would advise to write an object class with properties that can hold the data for each xml file. From that you have more freedom in doing what you want.

Personally, if I see your question and the task at hand, it looks like your somewhat in over your head.

best of luck.
 
Share this answer
 
v2

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