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 7190099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:26:30+00:00 2026-05-28T19:26:30+00:00

I will be doing an MVVM Project soon and I’m working a couple tutorial/examples

  • 0

I will be doing an MVVM Project soon and I’m working a couple tutorial/examples out. How do I take the following code and connect it to a database. If I were to have a datagrid, how can I change information in the datagrid and have it automatically update? I’ll be using MS SQL. Thanks for any tips or advice.

Class Person 

  Property _name As Integer
Property Name As Integer
    Get
        Return _name
    End Get
    Set(value As Integer)
        _name = value
        RaisePropertyChanged("Name")

    End Set
End Property
End class

Then in another class:

Class Collections

Public namelist As New ObservableCollection(Of Person)

    namelist.Add(New Person With {.Name = Nothing}) 

— Then in XAML

    <ObjectDataProvider x:Key="test" ObjectType="{x:Type local:Collections}"

     <DataGrid ItemsSource="{Binding Source= {StaticResource test}}">

      <DataGridTextColumn Header="Name" Binding="{Binding Sample, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

  ect...ect....ect...

Now where or how do I connect my MS SQL table to all this?

  • 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-28T19:26:31+00:00Added an answer on May 28, 2026 at 7:26 pm

    IF you’re using MVVM, then your bindings (if wired properly) will propagate changes you make in the GridView to the properties their bound too if you wire the events when a cell edit is finished, etc.

    Here’s a source on that:

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=563

    I’m coming from a C# only background but,

    for instance if you have a property of an observable collection:

     public ObservableCollection<string> Collection {get; set;}
    

    on the ViewModel, if you had bound your view (the .xaml) to the VM by setting the DataContext of the View, and you had bound this OC to a combobox changing the selectedValue on the combobox would update the SelectedValue you bound to in the .xaml.

    So if you had chosen for this combobox to be bound on SelectedValue to a property:

     public string SelectedValue {get; set;}
    

    when you selected one of the choices in the combobox would update that value on the view model and it would step into the set portion of the property.

    The same goes for whatever you have bound to the GridView. If you have an ObservableCollection that your gridview binds too, you’ll need to wire up the events on the view for when you feel a change should update the ViewModel and use the ICommand to propagate the change to the VM.

    Another question would be are you required to use VB? I know the frameworks that make MVVM easier like Caliburn.Micro are in C#, there must be some frameworks out there to make MVVM easy with VB. Although with what you’re trying, basic MVVM wouldn’t be that hard to setup, these frameworks usually save you time from having to wire up the bindings manually.

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

Sidebar

Related Questions

I recently checked out a large C# code base that I will be doing
I'm doing a homework project that requires this: Below you will find the code
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
I'm working in a WPF project, I'm using the MVVM patter in my project.
I have been working through some of the examples of MVVM & WPF and
New to MVVM...and I am noticing our ViewModel's are doing the following: They are
I will be doing an occiasional import from XML into core data. I have
Do you know any library that will help doing that? I would write a
I've got an app that will be doing a fair amount of communication with
I am doing small Silverlight app which will allow users to Create orders. I

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.