If we want to save data from WinForm; we just design our form, drag some labels & text-boxes on it and finally part of coding....
We have to code for Insert Data / Update Data / Delete Data...
for each work we design or code a individual part of coding...
But, here is the simplest way to do all that work without any coding and on a one single WinForm page...
Let's see :
1) Open your WinForm project & add new winform on it.
2) Go to Data --> Click on Show Data Source
3) Click on 'Add New Data Source'
4 ) Data Configuration window will be appeared.
Select 'Database' & click 'Next'
Select 'Dataset' click 'Next'
Your connection string may selected on ConnectionString ; if not click on 'New Connection' and select which database you want to select
Click 'Next'
5) Select which table you want to choose & enter unique and meaningful DataSet Name and Click 'Finish'
We have to code for Insert Data / Update Data / Delete Data...
for each work we design or code a individual part of coding...
But, here is the simplest way to do all that work without any coding and on a one single WinForm page...
Let's see :
1) Open your WinForm project & add new winform on it.
2) Go to Data --> Click on Show Data Source
[it will show DataSource window just left side of screen] |
3) Click on 'Add New Data Source'
4 ) Data Configuration window will be appeared.
Select 'Database' & click 'Next'
Select 'Dataset' click 'Next'
Your connection string may selected on ConnectionString ; if not click on 'New Connection' and select which database you want to select
Click 'Next'
5) Select which table you want to choose & enter unique and meaningful DataSet Name and Click 'Finish'
6) Select dataSet name which we recently added ...
7) After selected 'Details' view select Just 'Drag & Drop' Profile detail view on form .. it will see like below
8) that's it...
You can now 'Add/Delete/Update' data from just one single Winform page without doing any coding...
You can also see all your records from navigator buttons.
Thnak you.
No comments:
Post a Comment