Wednesday, 15 April 2015

c# - WebService to import entire table in android -


I have created a web service in C # and successfully wrote the getdata () function that receives the table from my database (on SQL Server 2008). I can not find it to call my Android app. I can share an example code. I need to synchronize the database and save the data in my local Android database. Here's my getdata function.
  [WebMethod] public dataset getData () {SqlConnection conn; Conn = ConnectionManager.GetConnection (); Conn.Open (); String sqlQuery = "select * from dbo.StudentContact"; SqlCommand command = new SqlCommand (sqlQuery, conn); SqlDataAdapter da = New SqlDataAdapter (command); Dataset ds = new dataset (); Da.Fill (DS); Conn.Close (); Return ds; }    

Please read the following: You can insert values ​​when you have called webservice In your database on the device (all the records you have selected).

No comments:

Post a Comment