
11/05/2005, 05:08
|
 | | | Fecha de Ingreso: noviembre-2004
Mensajes: 2.344
Antigüedad: 20 años, 3 meses Puntos: 8 | |
Claro, porque, sólo se queda con el último valor,
MyCommand.CommandText="";
i=1;
while (i< arr.Length)
{
if (Convert.ToString(ViewState["identificadores"]).IndexOf(arr[Convert.ToInt16(i)])!=-1)
{
//Response.Write("HOLA");
}
else
{
myCommand.CommandText += " Insert into UsuariosServicios (UsServIdServ,UsServIdUs) values (" + arr[i] +"," + ComboLogin.SelectedItem.Value +");";
}
i+=1;
}
myCommand.Connection.Open();
Response.Write(myCommand.CommandText);
myCommand.Connection.Close();
Si te das cuenta despúes de cada SQL he puesto un ;, esto es para MySQL para separar instrucciones, no se si con SQL Server será igual |