There are different ways to handle this. Probably the most common in WPF is to let your viewmodel handle manipulating the database (which is part of your model), typically through some sort of repository or facade. If you check out the reference MVVM WPF application you can see a simple version of this in action, eg:
public class CustomerViewModel : WorkspaceViewModel, IDataErrorInfo
{
...
public void Save()
{
if (!_customer.IsValid)
throw new InvalidOperationException(Strings.CustomerViewModel_Exception_CannotSave);
if (this.IsNewCustomer)
_customerRepository.AddCustomer(_customer);
base.OnPropertyChanged("DisplayName");
}
In this pattern, the repository object will usually maintain the database connection, but it's the viewmodel code that calls into the repository. And of course, you can replace that megalithic repository with a full-fledged DAL depending on your needs.