C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







populating datagridview from xml file


Posted Date: 24 Mar 2008      Total Responses: 5

Posted By: siddharth       Member Level: Silver     Points: 2


hi guys

i had already asked this question but did not get to understand it....
i have application (c#.net visual studio 2005) where in the user details like user name,user info,password(encrypted) are stored.. in one of my interfaces i need to display these info in datagridview except the password of course. i need a code in c# that does the same... in the datagrid view i need to provide in from of each user info a "check box",which when checked and delete button is pressed it deletes the entries from the datagridview as well as from the xml file.... i know we need to bind the xml file and the datagridview using data adapter but not getting it... so pls some one help me with problem...

thanks
Sid





Responses

Author: DurgaprasadCh    24 Mar 2008Member Level: SilverRating:     Points: 2
Hey Sid,

I'm not sure where exactly you are getting issue. Normally to bind XML to datagrid, you can use datasource and fill the data source from xml and bind it to datagrid.

Here is the code snippet that I often use.

DataSet ds = new DataSet();
ds.ReadXml(MapPath("config.xml"));
DataGrid1.DataSource = ds;
DataGrid1.DataBind();

Please let me know if this solves your problem.

-Durga.



Author: siddharth    24 Mar 2008Member Level: SilverRating:     Points: 2
hi Durga,

As suggested by u i made use of ur code and i am getting the following errors:

1.'System.Windows.Forms.DataGridView' does not contain a definition for 'DataBind'

2.The name 'MapPath' does not exist in the current context



Author: siddharth    24 Mar 2008Member Level: SilverRating:     Points: 2
hi Durga,

As suggested by u i made use of ur code and i am getting the following errors:

1.'System.Windows.Forms.DataGridView' does not contain a definition for 'DataBind'

2.The name 'MapPath' does not exist in the current context



Author: siddharth    24 Mar 2008Member Level: SilverRating:     Points: 2
hi Durga,

As suggested by u i made use of ur code and i am getting the following errors:

1.'System.Windows.Forms.DataGridView' does not contain a definition for 'DataBind'

2.The name 'MapPath' does not exist in the current context



Author: DurgaprasadCh    25 Mar 2008Member Level: SilverRating:     Points: 2
which version of frame work you are using? You can use Page.MapPath and regarding DataBind, it's in 2.0 and believe it exists in 1.1 too!


Post Reply
You must Sign In to post a response.
Next : Concatenation of array elements
Previous : MissingManifestException
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



Read TATA Nano reviews.
dotNet Slackers   BizTalk Adaptors    Web Design   Scripts
Are you waiting for engineering entrance result? Watch here for engineering entrance results.
teleconferencing

Contact Us    Privacy Policy    Terms Of Use