views:

33

answers:

1

Hi,

I use LINQ to SQL to get data from a database and use a service contract to access it in Silverlight at the client side. I display the data in a DataGrid. Now how do I make sure that any changes in the datagrid is written back to the database?

EDIT:

This is the example code I implemented: http://www.silverlight.net/learn/tutorials/sqldatagrid-cs/

Here I wanted any change in the datagrid reflected back in the database.

The SubmitChanges function works in the DataContext object which is:

public partial class DataClasses1DataContext : System.Data.Linq.DataContext

But this is not exposed in the contract and so not visible in the client side code.

A: 

Did you try to use this command :

_myDomainContext.SubmitChanges();

If your want more information take a look on article :

"How SubmitChanges works in .NET RIA Servies" : http://weblogs.asp.net/fredriknormen/archive/2009/08/10/how-submitchanges-works-in-net-ria-servies.aspx

Thomas Jaskula
I am not able to access the domain context in client side. Only the individual objects corresponding to each table is accessible. Should I write methods on server side which uses SubmitChanges and expose it to the client?
Manoj
Could you pls post some code?
Thomas Jaskula
Please check the edit to the question.
Manoj