Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Scenario is this :-
(1)i have a datagrid filled with values from a database
(2)i have a button in my asp.net page
(3)when i click my button it should export the datas from the datagrid to a xml file....!

i have done the the first 2 part, now how will i export the values of the datagrid to a xml file when the button is clicked ?

Can anybody help me regarding this?

Thanks and Regards
Akiii
Posted
Updated 29-Mar-11 0:52am
v2

Please check the following:

http://www.devx.com/tips/Tip/28651[^]
 
Share this answer
 
Comments
Tarun.K.S 29-Mar-11 7:51am    
Check your link again, it requires registration.
Akiii123 29-Mar-11 8:19am    
@Om Prakash Pant

i didnt understand the rendercontrol method......!
can u do it with xml support?

Akiii
As you fill your dataset.
DataSet ds=new DataSet();
SqlDataAdapter da = new SqlDataAdapter("select * from TabName");
da.Fill(ds);

Now you can use WriteXml which take 2 parameters
MIDL
ds.WriteXml(string filename, mlWriteMode mode);
 
Share this answer
 
Comments
Akiii123 29-Mar-11 8:19am    
thanks for the reply.

i have the data in datagrid, how will a query data from a datagrid and load it into SqlDataAdapter object ??

Akiii
thanks for the reply.

i have the data in datagrid, how will a query data from a datagrid and load it into SqlDataAdapter object ??

Akiii
 
Share this answer
 
Comments
Tarun.K.S 29-Mar-11 7:20am    
Remove this answer and add it as a comment to the respective answer.
@Om Prakash Pant

i didnt understand the rendercontrol method......!
can u do it with xml support?

Akiii
 
Share this answer
 
Comments
Tarun.K.S 29-Mar-11 7:20am    
Remove this answer and add it as a comment to the respective 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