
11/05/2005, 04:21
|
 | | | Fecha de Ingreso: abril-2005
Mensajes: 611
Antigüedad: 19 años, 10 meses Puntos: 1 | |
Increible pero cierto Pues en la label me pone perfectamente los servicios seleccionados. Con su # correspondiente. y me los kita si le doy al check del servicio. Eso esta perfecto.
Lo que no me va es lo de actualizar, no me saca la sql ni na.
lo tengo asi:
string sql=String.Empty;
int i=0;
while (i< arr.Length)
{
if (i==0)
{
sql = " where UsServIdServ==" + arr[i];
}
else
{
sql += " and UsServIdServ==" + arr[i];
}
i+=1;
}
sql = "Delete from UsuariosServicios " + sql + " and UsServIdUs=" + ComboLogin.SelectedItem.Value;
myCommand.Connection.Open();
myCommand.CommandText = sql;
Response.Write(sql);
myCommand.Connection.Close();
i=0;
while (i< arr.Length)
{
if ((ViewState["identificadores"]).ToString().IndexOf(arr[i].ToString())!=-1)
{
}
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(); |