FALLA EN WEBMATRIX

22/09/2004 - 19:18 por CRISTHIAN MASSA MEDINA | Informe spam
Hola amigos!!!

He encontrado una falla al crear un grid editable en el webmatrix usando
el asistente que muestra un ejemplo con la base pubs y de alli uno tiene que
modificar las sentencias SQL.

Escribo esto para que no les pase a ustedes porque he sufrido mucho por ese
error.

Lo que pasa es que al hacer clic en ingresar nuevo item o (add new item) si
tienes tu tabla vacia se genera error y no te da opción a modificar nada.
Este es el codigo y con mayuscula el error!!!!

Sub AddNew_Click(Sender As Object, E As EventArgs)
' add a new row to the end of the data, and set editing mode
'on'
CheckIsEditing("")
If Not isEditing = True Then
' set the flag so we know to do an insert at Update time
AddingNew = True
' add new row to the end of the dataset after binding
' first get the data
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand,
myConnection)

Dim ds As New DataSet()
myCommand.Fill(ds)

' add a new blank row to the end of the data
Dim rowValues As Object() {p.selecteditem.value,0,0,0,0,0,0,0, "-", 2}
ds.Tables(0).Rows.Add(rowValues)

' figure out the EditItemIndex, last record on last page
Dim recordCount As Integer = ds.Tables(0).Rows.Count

If recordCount > 1 Then ' AQUI ESTA EL ERROR!!!! debe decir

=1



recordCount -= 1
DataGrid1.CurrentPageIndex = recordCount \
DataGrid1.PageSize
DataGrid1.EditItemIndex = recordCount Mod
DataGrid1.PageSize

End If

' databind
DataGrid1.DataSource = ds
DataGrid1.DataBind()

End If

Espero para los poco experimentados como yo, nunca mas tengan este
problema!!!

Saludos!!!

Preguntas similare

Leer las respuestas

#1 Jorge Serrano [MVP VB]
22/09/2004 - 21:50 | Informe spam
Muchas gracias por avisar. :-)

Se agradece.

Un saludo,

Jorge Serrano Pérez
Microsoft MVP VB.NET
PortalVB.com
http://www.portalvb.com/
Weblog de Jorge Serrano
http://weblogs.golemproject.com/jorge/
No te olvides de:
http://www.microsoft.com/spanish/ms...des/vbnet/

Frase: "Si le das pescado a un hombre hambriento, le nutres durante una
jornada. Si le enseñas a pescar, le nutrirás toda su vida." Lao-Tsé - 600 AC
[aprox]


"CRISTHIAN MASSA MEDINA" <news.microsoft.com11> escribió en el mensaje
news:
Hola amigos!!!

He encontrado una falla al crear un grid editable en el webmatrix


usando
el asistente que muestra un ejemplo con la base pubs y de alli uno tiene


que
modificar las sentencias SQL.

Escribo esto para que no les pase a ustedes porque he sufrido mucho por


ese
error.

Lo que pasa es que al hacer clic en ingresar nuevo item o (add new item)


si
tienes tu tabla vacia se genera error y no te da opción a modificar nada.
Este es el codigo y con mayuscula el error!!!!

Sub AddNew_Click(Sender As Object, E As EventArgs)
' add a new row to the end of the data, and set editing mode
'on'
CheckIsEditing("")
If Not isEditing = True Then
' set the flag so we know to do an insert at Update time
AddingNew = True
' add new row to the end of the dataset after binding
' first get the data
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand,
myConnection)

Dim ds As New DataSet()
myCommand.Fill(ds)

' add a new blank row to the end of the data
Dim rowValues As Object() > {p.selecteditem.value,0,0,0,0,0,0,0, "-", 2}
ds.Tables(0).Rows.Add(rowValues)

' figure out the EditItemIndex, last record on last page
Dim recordCount As Integer = ds.Tables(0).Rows.Count

If recordCount > 1 Then ' AQUI ESTA EL ERROR!!!! debe


decir
>=1

recordCount -= 1
DataGrid1.CurrentPageIndex = recordCount \
DataGrid1.PageSize
DataGrid1.EditItemIndex = recordCount Mod
DataGrid1.PageSize

End If

' databind
DataGrid1.DataSource = ds
DataGrid1.DataBind()

End If

Espero para los poco experimentados como yo, nunca mas tengan este
problema!!!

Saludos!!!



Respuesta Responder a este mensaje
#2 DJ MIAO
23/09/2004 - 02:07 | Informe spam
webmatrix ?????????????????
Tu sigues perdiendo tiempo con esa mierda.
Eso es un fantasma.



Miao...
Comprate un libro..


Hola amigos!!!

He encontrado una falla al crear un grid editable en


el webmatrix usando
el asistente que muestra un ejemplo con la base pubs y


de alli uno tiene que
modificar las sentencias SQL.

Escribo esto para que no les pase a ustedes porque he


sufrido mucho por ese
error.

Lo que pasa es que al hacer clic en ingresar nuevo item


o (add new item) si
tienes tu tabla vacia se genera error y no te da opción


a modificar nada.
Este es el codigo y con mayuscula el error!!!!

Sub AddNew_Click(Sender As Object, E As EventArgs)
' add a new row to the end of the data, and


set editing mode
'on'
CheckIsEditing("")
If Not isEditing = True Then
' set the flag so we know to do an


insert at Update time
AddingNew = True
' add new row to the end of the dataset


after binding
' first get the data
Dim myConnection As New SqlConnection


(ConnectionString)
Dim myCommand As New SqlDataAdapter


(SelectCommand,
myConnection)

Dim ds As New DataSet()
myCommand.Fill(ds)

' add a new blank row to the end of the


data
Dim rowValues As Object() >{p.selecteditem.value,0,0,0,0,0,0,0, "-", 2}
ds.Tables(0).Rows.Add(rowValues)

' figure out the EditItemIndex, last


record on last page
Dim recordCount As Integer = ds.Tables


(0).Rows.Count

If recordCount > 1 Then ' AQUI ESTA EL


ERROR!!!! debe decir
=1



recordCount -= 1
DataGrid1.CurrentPageIndex =


recordCount \
DataGrid1.PageSize
DataGrid1.EditItemIndex =


recordCount Mod
DataGrid1.PageSize

End If

' databind
DataGrid1.DataSource = ds
DataGrid1.DataBind()

End If

Espero para los poco experimentados como yo, nunca mas


tengan este
problema!!!

Saludos!!!



.

Respuesta Responder a este mensaje
#3 Jorge Serrano [MVP VB]
23/09/2004 - 07:26 | Informe spam
Hola DJ MIAO,

a veces me sorprenden algunas de tus respuestas.

¿Tu nunca has utilizado el Bloc de Notas de Windows para escribir algún
texto en un momento dado?.
Supongo que más de una vez, a no ser que seas de esos que para escribir un
pequeño texto, prefieras cargar un programa que satura la CPU durante un par
de minutos con la carga en memoria de un montón de interesantes utilidades
que nunca vas a utilizar en lugar de tardar 30 segundos en hacer todo con un
programa sencillo.

Exactamente ocurre con WebMatrix y con otros muchos programas. Dependiendo
de lo que necesites y lo que vayas a hacer, igual no es necesario adquirir o
utilizar otro entorno o programa.

Levanto la mano para decir que yo al menos, cuando lo necesito, sigo
utilizando la "mierda" de WebMatrix.

Un saludo,

Jorge Serrano Pérez
Microsoft MVP VB.NET
PortalVB.com
http://www.portalvb.com/
Weblog de Jorge Serrano
http://weblogs.golemproject.com/jorge/
No te olvides de:
http://www.microsoft.com/spanish/ms...des/vbnet/

Frase: "Si le das pescado a un hombre hambriento, le nutres durante una
jornada. Si le enseñas a pescar, le nutrirás toda su vida." Lao-Tsé - 600 AC
[aprox]




"DJ MIAO" escribió en el mensaje
news:114f01c4a101$4aa0ade0$
webmatrix ?????????????????
Tu sigues perdiendo tiempo con esa mierda.
Eso es un fantasma.



Miao...
Comprate un libro..


Hola amigos!!!

He encontrado una falla al crear un grid editable en


el webmatrix usando
el asistente que muestra un ejemplo con la base pubs y


de alli uno tiene que
modificar las sentencias SQL.

Escribo esto para que no les pase a ustedes porque he


sufrido mucho por ese
error.

Lo que pasa es que al hacer clic en ingresar nuevo item


o (add new item) si
tienes tu tabla vacia se genera error y no te da opción


a modificar nada.
Este es el codigo y con mayuscula el error!!!!

Sub AddNew_Click(Sender As Object, E As EventArgs)
' add a new row to the end of the data, and


set editing mode
'on'
CheckIsEditing("")
If Not isEditing = True Then
' set the flag so we know to do an


insert at Update time
AddingNew = True
' add new row to the end of the dataset


after binding
' first get the data
Dim myConnection As New SqlConnection


(ConnectionString)
Dim myCommand As New SqlDataAdapter


(SelectCommand,
myConnection)

Dim ds As New DataSet()
myCommand.Fill(ds)

' add a new blank row to the end of the


data
Dim rowValues As Object() >{p.selecteditem.value,0,0,0,0,0,0,0, "-", 2}
ds.Tables(0).Rows.Add(rowValues)

' figure out the EditItemIndex, last


record on last page
Dim recordCount As Integer = ds.Tables


(0).Rows.Count

If recordCount > 1 Then ' AQUI ESTA EL


ERROR!!!! debe decir
=1



recordCount -= 1
DataGrid1.CurrentPageIndex recordCount \
DataGrid1.PageSize
DataGrid1.EditItemIndex recordCount Mod
DataGrid1.PageSize

End If

' databind
DataGrid1.DataSource = ds
DataGrid1.DataBind()

End If

Espero para los poco experimentados como yo, nunca mas


tengan este
problema!!!

Saludos!!!



.

Respuesta Responder a este mensaje
#4 CRISTHIAN MASSA MEDINA
24/09/2004 - 00:30 | Informe spam
Pero yo uso solo webmatrix
:)



"CRISTHIAN MASSA MEDINA" <news.microsoft.com11> escribió en el mensaje
news:
Hola amigos!!!

He encontrado una falla al crear un grid editable en el webmatrix


usando
el asistente que muestra un ejemplo con la base pubs y de alli uno tiene


que
modificar las sentencias SQL.

Escribo esto para que no les pase a ustedes porque he sufrido mucho por


ese
error.

Lo que pasa es que al hacer clic en ingresar nuevo item o (add new item)


si
tienes tu tabla vacia se genera error y no te da opción a modificar nada.
Este es el codigo y con mayuscula el error!!!!

Sub AddNew_Click(Sender As Object, E As EventArgs)
' add a new row to the end of the data, and set editing mode
'on'
CheckIsEditing("")
If Not isEditing = True Then
' set the flag so we know to do an insert at Update time
AddingNew = True
' add new row to the end of the dataset after binding
' first get the data
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand,
myConnection)

Dim ds As New DataSet()
myCommand.Fill(ds)

' add a new blank row to the end of the data
Dim rowValues As Object() > {p.selecteditem.value,0,0,0,0,0,0,0, "-", 2}
ds.Tables(0).Rows.Add(rowValues)

' figure out the EditItemIndex, last record on last page
Dim recordCount As Integer = ds.Tables(0).Rows.Count

If recordCount > 1 Then ' AQUI ESTA EL ERROR!!!! debe


decir
>=1

recordCount -= 1
DataGrid1.CurrentPageIndex = recordCount \
DataGrid1.PageSize
DataGrid1.EditItemIndex = recordCount Mod
DataGrid1.PageSize

End If

' databind
DataGrid1.DataSource = ds
DataGrid1.DataBind()

End If

Espero para los poco experimentados como yo, nunca mas tengan este
problema!!!

Saludos!!!



email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida