I am trying to build an silverlight application which takes user first name, last name, pass, email address in text boxes and then add these to the database.
For this i am using WCF Ria Services.
Steps i have followed are :
Added ADO.NET Entity Data Model and then Domain Service class in my project (in web part).
Now i have got some predefined methods in my DomainService Class like Insert, Update methods. I know how to show data in DataGrid but its not what i want.
What i want is to customize all this for :
When user clicks the submit button then there should be method inside this like AddInfo(all parameters) which can add all the data to my sql server database {at present LocalHost}.
In simple words accessing your database through custom methods to add data in sql server using WCF Ria Services
I know it was very simple while working in .net forms and all. But how about Silverlight & WCF ria ?
Please Suggest.
What you should do is write a custom method in server-side.
On server-side, you have a
DomainServiceclass that should inherit fromLinqToEntitiesDomainService<TContext>.Simply add a method in this class with the
Invokeattribute, for example:The logic to add a user to the database is really simple, just create a new
Entity, add it to the context and callcontext.SubmitChanges();When you compile the client RIA Services project, the auto-generated proxy class that correspond to your
DomainServicewill contain your new method, and you’ll be able to call it using: