iamsuperman
New member
- Joined
- Aug 17, 2005
- Messages
- 3
Hi all,
I am a newbie to programming and I am using Visual C# .NET to create a windows form which will show the records of an Access database in the Datagrid.
First, I dragged an OleDBDataAdapter from the tool box to the windows form, by using the wizard, I successfully created a OleDBConnection and generated the DataSet and then I dragged a DataGrid from the tool box to the windows form, and in the properties windows of the DataGrid, I set its DataSource to the generated DataSet and set its DataMember to a table of the Access database.
Also, I added the displayRecords() inside the blocks of Form1_Load(...) , which will make the "oleDbDataAdapter1" fill the "dataSet1" so that the records will be shown on the DataGrid once the windows form is loaded.
Then I could sucessfully view the records on this windows form. But I have a question, do I need any kinds of "data binding"? What will be the difference after adding some "data binding" statements?
Another question is, what methods or events will be triggered when changes are made to the DataSet inside the DataGrid? I want to know because I want a "Save" button to appear when changes are made to the DataSet.
Please help me. Thank you very much to you all.
I am a newbie to programming and I am using Visual C# .NET to create a windows form which will show the records of an Access database in the Datagrid.
First, I dragged an OleDBDataAdapter from the tool box to the windows form, by using the wizard, I successfully created a OleDBConnection and generated the DataSet and then I dragged a DataGrid from the tool box to the windows form, and in the properties windows of the DataGrid, I set its DataSource to the generated DataSet and set its DataMember to a table of the Access database.
Also, I added the displayRecords() inside the blocks of Form1_Load(...) , which will make the "oleDbDataAdapter1" fill the "dataSet1" so that the records will be shown on the DataGrid once the windows form is loaded.
Code:
public void displayRecords()
{
oleDbDataAdapter1.Fill(dataSet1, "book_stock");
}
Then I could sucessfully view the records on this windows form. But I have a question, do I need any kinds of "data binding"? What will be the difference after adding some "data binding" statements?
Another question is, what methods or events will be triggered when changes are made to the DataSet inside the DataGrid? I want to know because I want a "Save" button to appear when changes are made to the DataSet.
Please help me. Thank you very much to you all.