Hi All...
My requirement is -
I have a ASP.NET Website with SQL Server 2008 as backend.
There is a Class Library with total 15 class files.
There are more than 3lacs records in each table (2 Masters and 1 Transaction Tables).
Because of this, the system is running very slow.
I want to know-
1. How do I add a WCF Service to this existing website so that the website runs smoothly.
2. Is there any other way in which I can handle this website.
3. The Dropdownlist also takes more time in loading.
Thanks a lot in advance.
Loading
Riddhi ValechaPosted Aug 9, 2014, 10:45 PM
I am facing a lot of issues with the Webservice... Since the website is very large..
Is there a way to use .asmx page ?? i.e. .asmx web service ??
If yes, please let me know how???
Thanks a lot in advance.
Riddhi ValechaPosted Jul 29, 2014, 12:50 AM
Thanks a lot......
Is there any other way ??
I am asking because there are more than 100 methods in the Class Library Solution with 15 Class Files.
All methods include - Loading of data from database, inserting data in database, updating records, checking string values, date difference, No of months and days between two dates, etc. and so on.
I have already started applying this solution.
Thanks a lot... Thanks a ton...
Ramesh MaruthiPosted Jul 28, 2014, 12:48 PM
If you want to add a Wcf service for your solution follow this things
step 1: Create a wcf service project
Step 2 : Add Ado.net entity file to wcf service project and get all the table entities you want
for an example you have two tables person and job so when u grab this tables from data base it creates model and that model for example name it as mydatabaseentities has the classes for those tables in this way
public partial class person()
{
public int personId{get;set;}
public string personname {get;set;}
}
public partial class Job()
{
public int jobId{get;set;}
public string jobtype{get;set;}
}
1 ) In the Interface try to write the all operations you want for an example you want all the 3 lac person and job details from your database
[ServiceContract]
public partial interface Isample
{
[OperationContarct]
List
[OperationContarct]
List
}
2) In .svc file try to write logic for getting the person and job details form the database
public partial class sampleService :Isample
{
public List
{
using(mydatabaseentities context = new mydatabaseentities ())
{
List
select s).ToList();
return result;
}
}
public List
{
using(mydatabaseentities context = new mydatabaseentities ())
{
List
select s).ToList();
return result;
}
}
}
Then after that right click on the .svc file and choose an option view in browser u can get the .wsdl link
try to add that .wsdl reference to your project and use the operations u want from wcf service