Urgent ! Please Help...
hi, i am a beginner, do anyone how to store data into XML database using MS Visual C#.NET ??? example of my XML:
<Enrolment>
<Name></Name>
<Gender></Gender>
</Enrolment>
in my web interface, i got a button called "save", a textbox called "txtName", & a dropdownlist/combo box called "cboGender". so, after i enter (data) in all fields that i mentioned above(txtName, cboGender), then click the "save" button, it will store/save all the data that i enter into the XML database. in this program, it can't allow to use SQL connnection. i hope any expert can help me on this. below is my c# code:
private void cmdSave_Click(object sender, System.EventArgs e)
{
DataSet ds = new DataSet();
string filepath = @"C:\Documents and Settings\All
Users\Documents\Database.xml";
FileStream findata = new FileStream
(filepath,FileMode.OpenOrCreate,FileAccess.Write,
FileShare.ReadWrite);
ds.Tables["Enrolment"].Columns["FirstName"] = txtfname.Text;
ds.WriteXml(findata);
findata.Close();
}
P/s: i also dunno how to get the dropdownlist/combo box data & save it into XML database, because textbox property is .text, but combo box there are no .text.
i will appreciate if someone can help me....thanks a lot...
regards,
ck.
__________________
ck.
|