Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 779475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:55:57+00:00 2026-05-14T19:55:57+00:00

Ok so I have made a DataSet that reads the data hardcoded but unsure

  • 0

Ok so I have made a DataSet that reads the data hardcoded but unsure how I can read input from user to replace that hardcoded data.

I have a form with a textbox and submit button, I want to save data to xml after going through my DataSet.

Kinda new to programming, hoping someone can give me some pointers here.

public partial class Form1 : Form
{   

    // DataSet

    DataSet ds = new DataSet();
    DataColumn email = new DataColumn();

    public Form1()
    {
        InitializeComponent();

        email = new DataColumn("Email", Type.GetType("System.String"));            
        ds.dt.Rows.Add(0, "my_email");
        ds.dt.Rows.Add(1, "my_email");

        var results = from myRow in ds.dt
                      orderby myRow.id
                      where myRow.id == 0
                      select myRow;

        foreach (var item in results)
        {
            ds.dt.WriteXml("email.xml");  
        } 
    }

}

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:55:58+00:00Added an answer on May 14, 2026 at 7:55 pm

    Not really sure what you’re trying to do without further information.
    Maybe this will get you a bit further?

    public partial class Form1 : Form
    {
        DataSet ds = new DataSet();
    
        public Form1()
        {
            InitializeComponent();
    
            ds.Tables.Add("dt");
            ds.Tables[0].Columns.Add("id");
            ds.Tables[0].Columns.Add("email");
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            int count = ds.Tables[0].Rows.Count;
            ds.Tables[0].Rows.Add(count, textBox1.Text);
        }
    
        private void button2_Click(object sender, EventArgs e)
        {
            ds.Tables[0].WriteXml("email.xml");
        }
    }
    

    One textbox for input, one button for adding items to the dataset from the inputbox and one button for writing the xml to a file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a code that read data from flash Nand (without filesystem). fd
I made an application that generates reports based on data from a database. The
I have a gridview that is loaded from a DataSet, in which most of
I have made a jQuery toggle for a menu that I had in mind.
I have made a cart and the cart has remove item button, but the
I have made my own exception class which derives from runtime_error and is getting
I have a hypothetical set of data with 3 columns that has monthly profit
I have a program that shows data in a datagridview. The data in the
I have a report which grabs a whole bunch of statistical data that represent
I am working on an application that works like this: It fetches data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.