- public partial class frmClients : Form
- {
- public SQLiteDataAdapter daClients;
- public DataSet DS=new DataSet();
- public int rowID;
- ...
- // on form_load daClients gets the datas from the database
- // and then get a new dataset, because we don't wanna display all the columns in a DataGrid
- DataSet dsListed=new DataSet();
- SQLiteDataAdapter daC = new SQLiteDataAdapter("select id,companycode as Code, name as Name, deleted as Deleted from clients", daClients.SelectCommand.Connection);
- // popultae the DataGrid with, filtred by the FieldName
- daC.Fill(dsListed,"clients");
- dataGrid1.SetDataBinding(dsListed, "clients");
- // I have a method to determinate the selected ID, using the DataGrid1.CurrentRowIndex, and passing to the rowID the "id" column's value
- // so until thIs it works everything fine, if i hit an update button with the following code,
- daClients.Update(DS);
- // it updates the database
- // i understood everything until this point
- // i can access the client's data by DS.Tables["clients"].Rows[rowID]
- }
Community discussion forum
need help with datasets
Last post was 02 Mar 2008 at 15:17
Tags:
South Africa
Post a reply
Related discussion
-
How to Export Datagridview contents to Excel
by mohammed seidu (7 replies)
-
Inserting line break in gridview header text
by linus_hcu (4 replies)
-
Socket Programming in C# - Part 1
by kancherlasravan (18 replies)
-
Creating a database connection
by koshil (9 replies)
-
Forums
by karan_21584 (4 replies)
Related articles
Quick links
Recent activity
- mac clark replied to Complete portal of VOIP pro...
- Vijay Kumar Tripathi replied to I have to print the content...
- Rajasekhar Reddy replied to increase maxRequestLength i...
- Cason Lopez replied to Need suggestions......
- Subhadip Roy replied to help me in file handling in...
- Maneesh Jain replied to Complete portal of VOIP pro...
Enter your message below
Sign in or Join us (it's free).