0

I was wondering what would be the best way to insert a row into my sql table through WPF application window. I have two wpf DataGrids in my application, and I want the user to be able to push a button and insert data into the grid from there (inserting data into the sql table and refresh the grid when the user closes the pop-up window after inserting). I´m using a DataSet database model and running .sdf database inside my application.

I´m using a TableAdapter to fill my DataGrid:

    HomeApplication.TheHomeApplicationDBDataSet theHomeApplicationDBDataSet;
    HomeApplication.TheHomeApplicationDBDataSetTableAdapters.AccountingTableAdapter  homeApplicationDataSetAccountingTableAdapter;

What is the best way to do this? Any ideas would help. thx :)

1
  • Start reading this example and change the appropriate database connection , parameters and variables to fit your environment dotnetcurry.com/ShowArticle.aspx?ID=566 Commented Jan 12, 2013 at 19:45

1 Answer 1

1

WPF doesn't help you for data acces. So you can do something like that northwindDataSet1.Customers.Rows.Add(newCustomersRow);

Sign up to request clarification or add additional context in comments.

1 Comment

I solved this like that theHomeApplicationDBDataSet.AccountingIncome.Rows.Add(null, "Wage A", 3000, null, "2013-01-01"); This is stored in my sql table and my wpf datgrid picks up the changes right away :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.