Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:38:41+00:00 2026-05-26T08:38:41+00:00

I am using a WPF datagrid to display my contents in a SQL Server

  • 0

I am using a WPF datagrid to display my contents in a SQL Server Database. The contents in the datagrid are binded to a view in the database. I populate the datagrid on window loaded by the following:

this.myAccountantDBDataSet = MyAccountant
    .MyAccountantDBDataSet(this.FindResource("myAccountantDBDataSet");

// Load data into the table AccountData.
this.accountDataAdapter = new MyAccountant
    .MyAccountantDBDataSetTableAdapters.AccountDataTableAdapter();
this.accountDataAdapter.Fill(myAccountantDBDataSet.AccountData);

System.Windows.Data.CollectionViewSource accountDataViewSource =
    (System.Windows.Data.CollectionViewSource)
    this.FindResource("accountDataViewSource");
accountDataViewSource.View.MoveCurrentToFirst();

What I am wondering, is how to save updates, inserts, and deletions back to the database since what I am showing in the datagrid is a view. The database table and views looks like this:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:38:42+00:00Added an answer on May 26, 2026 at 8:38 am

    Updates will work, because the fields in the view map 1:1 to fields in the underlying tables, so Sql Server will be able to resolve updates in the view back to the tables (even AccountType).

    Inserts will not work because Account.AccountTypeId can not be set and I assume that it is a mandatory field.

    Deletes will not work, because Sql Server cannot tell which record in which table you are trying to delete.

    I think in this case, you can just as well work with Accounts records and show AccountTypeId in a DataGridComboBoxColumn that has AccountData as datasource, displays AccountData.AccountType and binds to Account.AccountTypeId.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the WPF toolkit datagrid to display some data and want to
I am using WPF toolkit provided DataGrid control to display product list along with
I'm using the WPF Toolkit's DataGrid to display a set of search results. As
I am using WPF toolkit Datagrid. I have a rowvalidationrule defined on this. to
I'm using the wpf toolkit datagrid to display an observable collection of AccountViewModels. The
Using the WPF DataGrid I have the need to change various display and related
I'm using the .NET4 WPF DataGrid to show a SQL table containing lots of
I am using a DataGrid object from the WPF toolkit. I am binding the
The following WPF code displays the contents of FirstName and ZipCode in the WPF
I am using WPF DataGrid and I would like to allow the user to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.