I have a problem, I want to record in a database of several images, these I have converted the string, the first three images be recorded properly, but when more than three there is always an error and leaves no record the following records, I ve tried everything, I'm using as a web service (asmx) in c #. My database I have the sql server 2008 and the fields for the pictures are type varchar (max)
function enviar_fotos()
{
contador = 0;
lbl_mensaje.text = 'Insertando Fotos Lugar de Instalación...';
var db = Ti.Database.install('/miData/kabateus','kabateus');
//var resul = db.execute('SELECT * FROM CI_FOTOS WHERE CODIGO_LIN=?',_codigolin);
var resul = db.execute('SELECT * FROM CI_FOTOS order by CODIGO_LIN');
//var filas_c = resul.getRowCount();
while (resul.isValidRow())
{
contador++;
var http = 'httpFotos'+contador.toString();
try
{
var xcodigoLIN = resul.fieldByName('CODIGO_LIN');
xfoto = resul.fieldByName('FOTO');
var xnombre = resul.fieldByName('NOMBRE')
var enviar = 'http://192.168.2.34/WebKabateus/WS_Kabateus.asmx/GrabarFotoLugInstal';
//var httpFotos = Titanium.Network.createHTTPClient();
http = Titanium.Network.createHTTPClient();
//httpFotos.open('POST',enviar);
http.open('POST',enviar);
var datos = {
codigoLIN:xcodigoLIN,fotoLIN:xfoto,nombrefoto:xnombre
}
data = JSON.stringify(datos);
var params = {
trama: data
};
//httpFotos.send(params);
http.send(params);
/*httpFotos.onload = function()
{
if(this.status == '200')
{
var oRegExp = new RegExp("<string[^>]*>(.*?)<\/string>", "ig");
var result = oRegExp.exec(this.responseText);
var valores = result[1];
if(valores == 'OK')
{
}else{
}
}else{
}
}*/
resul.next();
}catch(e)
{
alert(e.message);
}
}
resul.close();
db.close();
}