ASP - ACTUALIZAR BD SQL DESDE GRILLA

 
Vista:

ACTUALIZAR BD SQL DESDE GRILLA

Publicado por NEURON (6 intervenciones) el 10/06/2005 17:23:56
NECESITO TRAER EN UNA GRILLA LOS DATOS DE UNA TABLA DE UNA BD DE SQL, LA CUAL POSEE UNA CAMPO CUYOS VALORES SON 1 Ó 0 . NECESITO CAMBIAR SU VALOR Y ACTUALIZAR DEMANERA INDIVIDUAL Ó TODO LOS CAMBIOS DE LA GRILLA.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por tintin (40 intervenciones) el 10/06/2005 18:19:52
La verdad es que si no te explicas mejor, aqui no te va a ayudar ni txus, ya que me molesto en leer tu korreo, podrias saludar, exponer y agradecer.

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por NEURON (6 intervenciones) el 11/06/2005 16:09:32
HOLA, ME DISCULPAN LA VERDAD ES QUE LLEVO MUCHO TIEMPO BUSCANDO UNA RESPUESTA, Y POR EL ALFAN SE ME PASO.

YO MUESTRO POR MEDIO DE UN DATAGRIB LOS DATOS DE UNA TABLA, COMO EJEMPLO LA TABLA DE AUTORES DE LA BASE DE EJEMPLO DE SQL SERVER. CON LOS DATOS ID, NOMBRE , APELLIDO Y CONTRATO, ESTE ULTIMO MANEJA LOS VALORES 1 Ó 0.

ADEMAS LO DEBO MOSTRAR COMO CHEBOX.

YO NOSE COMO HACER PARA QUE LOS VALORES DE ESTE COLUMNA EN EL DATAGRIB SE ALMACENA EN LA TABLA DE LA BASE DE DATOS. PUEDE SER CADA VEZ QUE ACTIVE O DESACTIVE EL CHEBOX Ó POR MEDIO DE UN BOTON QUE MERECORRA EL DATAGRIB Y ACTUALICE LA TABLA EN LA BASE DE DATOS.

ME EXPLIQUE MEJOR?

DE ANTEMANO LES AGRADESCO SU COLABORACION , LO NECESITO MUY URGENTE.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por tintin (40 intervenciones) el 11/06/2005 16:39:41
vamos aver si me aclaro. yo lo haria así:

primero aces una tabla para mostrar los datos, kon sus cabeceras, algo asi:

id_______________nombre_______________apellido___________contrato

y aki debajo es kuando empieza el tema:

asi tienes ke acer kon la kabecera:

<table>
<tr>
<td>ID</td>
<td>NOMBRE</td>
<td>APELLIDO</td>
<td>CONTRATO</td>
</tr>
'dejamos un espacio
<tr>
<td> </td>
</tr>
'hacemos la consulta de todos los datos de la tabla
<%set datos = conexion.Execute("select * from mi_tabla order by nombre")%>
'recorremos la consulta para que te muestre todos
<%do while not datos.eof%>
<tr>
<td><%=response.write("id")%></td>
<td><%=response.write("nombre")%></td>
<td><%=response.write("apellido")%></td>

'Ahora viene tu duda, la del checbox, atento
<td><input name="contrato" type="checkbox" <%if datos("contrato")=1 then%>checked<%end if%></td>
</tr>
'Nos movemos al siguiente registro
<% datos.movenext%>
'cerramos en bucle
<%loop%>
</table>

Creo ke esta bien asi, pruebalo, y me dices algo con lo que sea,
un saludo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por NEURON (6 intervenciones) el 11/06/2005 17:05:46
OK ME HAS COMPRENDIDO LA PRIMERA PARTE.

LA VERDAD ES QUE SOLO HE TRABAJODO EMPIRICAMENTE CON ASP, POR LO TANTO MI MANEJO ES BAJO, YO HE TRABAJADO MAS CON ASP.NET Y WEBMATRIX Y NO SE HASTA DONDE LA CONEXION CON LA BASE DE DATOS SEA IGUAL O PARECIDA.

PERO ME SERVIRA DE MUCHO LA COLABORACION QUE ME HAS BRINDADO.

VOLVIENDO AL TEMA:

DESPUES DE LLENAR EL DATAGRID CON LOS DATOS ATRAVEZ DEL BUCLE, TENGO QUE CAMBIAR EL ESTADO DEL CONTRATO. HASTA HORA NINGUN PROBLEMA, Y ACTUALIZAR LA BASE DE DATOS CON LOS NUEVOS VALORES.

NO IMPORTA SI ES CADA VEZ QUE DE CLICK EN EL CHECBOX O EN UN SOLO BOTON ACTUALIZAR TODOS LOS CAMBIOS HECHOS EN EL DATAGRID EN LA TABLA DE LA BASE DE DATOS.

ESPERO ME HAYA EXPLICADO.

GRACIAS POR TU COLABORACION.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por Pedro (6 intervenciones) el 11/06/2005 18:30:23
PUEDES HACERLO ASI O TAMBIEN PUEDES PONER UN BOTON QUE TENGA LLAME A UN ACTION GUARDAR Y EN ESE BOTON FORMAS UN ARREGLO MIRA, ASI MAS O MENOS
var Txt = "" + Texto
var Txtemp = ""
if (Txt.length > 0) {
for (j=0;j<Txt.length;j++) {
if (Txt.substring(j,j+1) == ",") {
Arreglo[Arreglo.length] = Txtemp
Txtemp = ""
} else {
Txtemp += Txt.substring(j,j+1)
}
}
if (Txtemp.length > 0) {
Arreglo[Arreglo.length] = Txtemp
}

entonces tu ya tienes un arrelgo, no?, ahora barres cada chunche y lo escribes en bd
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por NEURON (6 intervenciones) el 11/06/2005 18:43:33
HOLA,

NO TE ENTIENDO MUY BIEN, PUEDES SER MAS CLARO.

GRACIAS.
ATT
NEURON
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:ACTUALIZAR BD SQL DESDE GRILLA

Publicado por Pedro (6 intervenciones) el 11/06/2005 19:01:42
deseas que explique el codigo linea por linea, si quieres agregame al messenger de msn [email protected]
Gracias, espero ayudarte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar