Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.22/5 (2 votes)
I am developing an android app in this i want to connect sql server database which is located in my server.I am using WCF Services to connect this and i had method with parameters(string,xelement,string).

Please help me.Thanks in advance
Posted
Comments
Tomas Takac 19-Nov-14 6:08am    
What did you try so far? Can you post some code? Where exactly is the problem?
Raghu Golla 20-Nov-14 6:06am    
I need code for doinbackground() method,so far i had written nothing.I had three parameters in wcf service method of types string,xelement and string.
I want to pass these parameters values from my front end(android app) and after that i want to retrieve data from sql server database and assign it to tablelayout.

1 solution

Hi,

You can develop WCF Rest service and call them from your android application.

it simple your can even migrate your Service already developed by appending simple extra lines of code.

Example for sending mail:
C#
[OperationContract]
        [WebInvoke(Method="GET",
            ResponseFormat = WebMessageFormat.Json,
           RequestFormat = WebMessageFormat.Xml,
           BodyStyle = WebMessageBodyStyle.Wrapped,
           UriTemplate = "SendMail/{FName}/{LName}/{Phone}/{Email}")]
        string SendMail(string FName,string LName,string Phone,string Email);


In WCF Service you can easily connect to sql server with help of ADO.Net connections.

Hope this address your problem.
 
Share this answer
 

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