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

  • SEARCH
  • Home
  • 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 6155473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:26:29+00:00 2026-05-23T20:26:29+00:00

im new to wpf, so please bear with me i made a window for

  • 0

im new to wpf, so please bear with me

i made a window for the purpose of managing “profile” records

while the navigation and updating is working

i cannot seem to get insertion working, as well

heres the very simple code

Imports System.Collections.ObjectModel

Public Class Window1
Dim WindowEntities As New DataEntities
Dim WindowList As ObservableCollection(Of Profile)

Function ProfilesViewSource() As CollectionViewSource
    Return CType(FindResource("ProfilesViewSource"), CollectionViewSource)
End Function
Function DefaultView() As CollectionView
    Return CollectionViewSource.GetDefaultView(ProfilesViewSource.View)
End Function

Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles MyBase.Loaded
    WindowList = New ObservableCollection(Of Profile)(From x In WindowEntities.Profiles Order By x.ProfileName)
    ProfilesViewSource.Source = WindowList
End Sub

Private Sub btnSave_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles btnSave.Click
    WindowEntities.SaveChanges()
End Sub

Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles btnAdd.Click
    WindowList.Add(New Profile)
    DefaultView.MoveCurrentToLast()
End Sub

Private Sub btnNext_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Handles btnNext.Click
    DefaultView.MoveCurrentToNext()
End Sub
End Class

when i press add, i get a new empty record, when i fill it in, i see that the collection sees it, as there is an onform listbox showing the profiles, and it gets listed there, so its actually attached to the list, but the savechanges command does not insert it into the db

there may be some validation errors upon insert, but then i would get some indication, right? now its just silently failing. as if i never tied to commit changes

thank you very much for your help fellows

  • 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-23T20:26:29+00:00Added an answer on May 23, 2026 at 8:26 pm

    (by IVerzin)
    1. create new Profile.
    2. Add it to WindowEntities
    3. Add it to WindowList

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

Sidebar

Related Questions

I am new to WPF/XAML so please bear with the noob question. I have
I'm fairly new to VB.net and WPF (and programming in general), so please bear
I'm very new to WPF, so please bear with me. Basically I have defined
While designing a new WPF application I noticed exceptions not being thrown during data
I'm pretty new to WPF, so please understand if this question is too simple.
I am pretty new to WPF and I cannot figure out how to update
I am only starting to learn WPF so please bear with me if this
I am working on WPF TreeView s. I am able to add the new
First I just want to say I am new to WPF, so please excuse
I am new to WPF programming. Please help me here. I want the data

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.