• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

dataset

hi. how do i add and delete data using dataset? i am doing on a device application using C#.
0
DWR200
Asked:
DWR200
  • 5
  • 2
  • 2
2 Solutions
 
DhaestCommented:
0
 
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:
Is your dataset bound to a database or not ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now