MekasDotNet
Skip Navigation Links
Home
---------------
Code Converter
---------------
Downloads
---------------
Forums
---------------
ReferenceSites
-------------
Contact Us

This Project is to Insert data using WCF & Linq

1.  Go to Visual Studio->New Project/WCF Service Application.This opens a new website with a default page.



2. Go to IService, add one [Operation Contract] to Insertdata into the table.



3. Go to Webiste, Add new item---> Linq to Sql classes.



4.Drag & drop the table to which u would like to insert the data from the database explorer as shown:



5.Go to Service1.svc.cs and then write the code as below and run it:



6. You will get the output as follows: copy that URL.(Remember this is your server).



7.Open another new website(it is supposed to be your client).

8.Go to Design, take 3 labels, 3 textboxes and 1 SAVE Button. The label names should be your column names, in your database.



9.Right click on the App_web reference and click on ADD Service Reference , paste the URL from the server and then press OK

10.Now double click on the button and then write the code as follows:


11. Run the Application. You will get the output as follows: Enter the details,in the textboxes and then click on the SAVE Button.



12. You will find the Inserted details in your database.

   
Your Feedback:
Post Name:
Post E-mail:  
Post Comment: