我必须将sqlite的数据插入SQL server.First将所有数据存储在sqlite数据库中,然后单击一个按钮,整个数据应插入SQL Server中。我的问题是,第一行插入所有行。 例如,如果我在Sqlite中插入了三个不同的行,但这三行在Sql server中具有相同的第一行值。
我在这个中使用数组列表,我不知道如何在soap web服务中传递这些数组列表。
push.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
ArrayList<Details> lst=new ArrayList<Details>();
Database db=new Database(MainActivity.this);
SQLiteDatabase sb=db.getReadableDatabase();
Details det=new Details();
Cursor cus=sb.rawQuery("select * from Auction",null);
cus.moveToFirst();
SoapObject request=new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
for(int i=0;i<cus.getCount();i++)
{
det.Boatnum= cus.getString(0).toString();
det. Buyername=cus.getString(1).toString();
det. amount= cus.getString(2).toString();
lst.add(det); //Array list values
request.addProperty("Boatnum",det.Boatnum);
request.addProperty("Buyername",det.Buyername);
request.addProperty("amount",det.amount);
envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
httpTransport = new HttpTransportSE(SOAP_ADDRESS);
try
{
serviceCall();
}
catch (Exception exception) {
}
cus.moveToNext();
}
}
});