In this code I have to insert sqlite data's to SQL server.First I have to store all data's in sqlite database and then clicking a button the entire data should be inserted in SQL server.My problem is the first row only inserted in all rows.For example; if I inserted three different rows in Sqlite,but the three rows have same first row values in Sql server.... how to resolve.I'm using Move to first and Move to next also...but I can't get. Guys I need your help
public void onClick(View v) {
// TODO Auto-generated method stub
Database db=new Database(MainActivity.this);
SQLiteDatabase sb=db.getReadableDatabase();
Cursor cus=sb.rawQuery("select * from Auction",null);
cus.moveToFirst();
for(int i=0;i<cus.getCount();i++)
{
String Boatnum= cus.getString(0).toString();
String Buyername=cus.getString(1).toString();
String amount= cus.getString(2).toString();
request.addProperty("Boatnum",Boatnum);
request.addProperty("Buyername",Buyername);
request.addProperty("amount",amount);
envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
httpTransport = new HttpTransportSE(SOAP_ADDRESS);
try {
serviceCall();
}
catch (Exception exception) {
//Toast.makeText(getActivity(), "Registered Successfully", Toast.LENGTH_LONG).show();
}
cus.moveToNext();
}
}
Aucun commentaire:
Enregistrer un commentaire