Click here to Skip to main content
15,895,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually i am executing one stored procedure in sql and i am getting that data into wcf and i am storing data in one list view...from there i want to retrieve the data to my .cs page. is it possible or not
Posted
Updated 1-May-13 0:06am
v2

1 solution

Hi,

Yes, you can pass your data from WCF to your .CS file but first you need to add service reference and then create the instance of your service client. After that all the accessible members will be available to calling class.


Thanks
 
Share this answer
 
Comments
ntitish 1-May-13 5:29am    
sir i had a one more question...Actually how to execute wcf services step by step process. that means in aspx.cs file we can see each and every parameter value by break point.. like that how can we see output parameter values in wcf file... with out calling in .aspx.cs file
Satyendra Kumar(Analyst Programmer) 1-May-13 5:36am    
Hi you can not debug WCF services directly but if you have added WCF to your solution then you can press F11 to jump to WCF service method from your .CS file and can see parameter values.
ntitish 1-May-13 6:41am    
Sir are u there.
ntitish 1-May-13 6:24am    
in iservice.cs
[operationcontract]
list< result> method(string name);

[datacontract]
public class result
{

[DataMember]
public int no
{
get { return no;}
set { no= value; }
}
[DataMember]
public int age
{
get { return age;}
set { age= value; }
}

}

in wcf service.cs

public list< result> method( string name)
{
sqlcon
sql command type procedure name-input,no-output,age-output
result rs=new result();
rs.no=cmd.parameters["@no"].value;
rs.age=cmd.parameters["@age"].value;
list< result> rls=new list< result>;
rls.add(rs);

}

in aspx.cs file

ServiceReference2.Service1Client obj2 = new ServiceReference2.Service1Client();

calling over now i want to retrive list


list< result> = obj2.method(name.text);

now how can i retrieve data in .cs
ntitish 1-May-13 6:42am    
Error 18 Cannot implicitly convert type 'sample.ServiceReference2.result[]' to 'System.Collections.Generic.List<sample.smaster.result>'

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900