I have a web-service in .NET it's inserting and retrieving data's from database as object's.. I'll copy some part of web-service here..
[WebMethod(Description = "This is used to insert details into sql server")]
public string InsertDetails(DataTable myDetails, string STR1)
{
try
{
foreach (DataRow row in myDetails.Rows)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.InsertQry";
cmd.Parameters.Add(new SqlParameter("@P_no", row["POD_Number"].ToString()));
cmd.Parameters.Add(new SqlParameter("@P_id", STR1));
cmd.Parameters.Add(new SqlParameter("@P_author", Convert.ToInt64(row["P_author"])));
//opening the connection
cmd.Connection = sqlCon;
sqlCon.Open();
int retValue = cmd.ExecuteNonQuery();
sqlCon.Close();
if (retValue == 0)
return "false";
}
return "true";
}
catch (Exception ex)
{
ErrorLogger(ex);
return "false";
}
}
//-----------------------------------------------------------------------------------
[WebMethod(Description = "This is used to get details from sql server")]
public DataSet GetDetails(string STR1)
{
DataSet ds = new DataSet();
try
{
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "dbo.SelectQryFromDB";
//opening the connection
cmd.Connection = sqlCon;
sqlCon.Open();
ds.DataSetName = "myTbl";
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds,"myTbl");
sqlCon.Close();
return ds;
}
catch (Exception ex)
{
ErrorLogger(ex);
ds.DataSetName = "Error";
return ds;
}
}
//----------------------------
Any-one Help me by providing me the details how can i send those data's and retrieve data's in Android..This is my first application so i don't know much?? Please Provide me details so that i can insert and get data's using web-service??
I heard of kSOAP2 and i'm trying to accomplish this by using kSOAP2..