I need to set the MoneyEarned to 0 and I do not want to change the firstname and lastname that is already stored in the DB, this is my function can you anyone advise me please to rewrite the update function please.
public void UpdateMoneyEarned(User user)
{
using (var db = new TeachableEntities())
{
user.MoneyEarned = 0;
var q = db.Users;
db.submitchanges();
CSharper11
Member
51 Points
36 Posts
Update
Mar 25, 2012 07:05 PM|LINK
This is my User Table
FirstName
LastName
MoneyEarned
I need to set the MoneyEarned to 0 and I do not want to change the firstname and lastname that is already stored in the DB, this is my function can you anyone advise me please to rewrite the update function please.
public void UpdateMoneyEarned(User user)
{
using (var db = new TeachableEntities())
{
user.MoneyEarned = 0;
var q = db.Users;
db.submitchanges();
}
}