dataset

hi. how do i add and delete data using dataset? i am doing on a device application using C#.
DWR200Asked:
Who is Participating?
 
Gautham JanardhanCommented:
                 System.Data.DataSet FSet =
                        new System.Data.DataSet();
                  FSet.Tables.Add("TableName");
                  FSet.Tables["TableName"].Columns.Add("ColumnName1");
                  FSet.Tables["TableName"].Columns.Add("ColumnName2",typeof(int));

                  //adding Data
                  System.Data.DataRow FRow =
                        FSet.Tables["TableName"].NewRow();
                  FRow["ColumnName1"] = "data";
                  FRow["ColumnName2"] = 10;
                  FSet.Tables["TableName"].Rows.Add(FRow);

                  //Updating

                  FSet.Tables["TableName"].Rows[0]["ColumnName2"] = 1;


                  //Deleting Rows

                  FSet.Tables["TableName"].Rows[0].Delete();
0
 
DhaestCommented:
0
 
DhaestCommented:
Is your dataset bound to a database or not ?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
DWR200Author Commented:
yes. i need to use MYSQL at the end of my project.
0
 
DhaestCommented:
How are you going to show, update, delete, ... your records ?
0
 
Gautham JanardhanCommented:
0
 
DWR200Author Commented:
because i am currently converting java codes to C#. where face codes using recordstore like openRecordstore, deleteRecordstore etc. so i was thinking of using datasets to replace recordstore.
0
 
DhaestCommented:
Several examples given by Dhaest & gauthampj (no specific problems given to solve)
My suggestion is to split the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.