If you are new to ADO.NET then I will suggest you to see my previous article
How to add DataSet and Add Database table to a DataSet
We will start from our previous article where we create a dataset and put two tables on that dataset.
1.(To find your DataSet)Solution Explorer->Click on App_Code smart tag->You will see your DataSet->Double click on Dataset so that it will show on Design window.
2.Right Click on your desired table(here Login table)->Add->Click Query->Next(Make sure Use Sql Statements is selected)->Select Insert->Next->(It's optional you can click Query Builder to see your query is working properly->Click Execute Query->Insert your value->Ok->You will see a message one row affected->Ok->Ok)->Next->Next->Finish
3.Add a new windows form->Add two label,two textbox and a Button->Also add a Gridview->
Your Design window should look like this
4.Click smart tag of your GridView->Select New DataSource
Select Object->Ok->Select your Table Adapter->Finish->Checked the CheckBox Enable Sorting,Editing,Deleting,selecting(as your requirement)
5.Double click on the Button(Insert button)->And write this code
6.Click F5 to run your project
How to add DataSet and Add Database table to a DataSet
We will start from our previous article where we create a dataset and put two tables on that dataset.
1.(To find your DataSet)Solution Explorer->Click on App_Code smart tag->You will see your DataSet->Double click on Dataset so that it will show on Design window.
2.Right Click on your desired table(here Login table)->Add->Click Query->Next(Make sure Use Sql Statements is selected)->Select Insert->Next->(It's optional you can click Query Builder to see your query is working properly->Click Execute Query->Insert your value->Ok->You will see a message one row affected->Ok->Ok)->Next->Next->Finish
3.Add a new windows form->Add two label,two textbox and a Button->Also add a Gridview->
Your Design window should look like this
Select Object->Ok->Select your Table Adapter->Finish->Checked the CheckBox Enable Sorting,Editing,Deleting,selecting(as your requirement)
5.Double click on the Button(Insert button)->And write this code
6.Click F5 to run your project
No comments:
Post a Comment