modificar
Publicado por hector (78 intervenciones) el 28/09/2007 00:20:18
hola a todos necesito ayuda para modificar unos datos, elcodigoque tengo paraguardar es el siguiente:
Dim conexion As New SqlClient.SqlConnection
Dim cmdpresentacion, inspresentacion As New SqlClient.SqlCommand
Dim adappresentacion As New SqlClient.SqlDataAdapter
Dim dpresentacion As New DataSet
conexion.ConnectionString = "workstation id=HECTOR;packet size=4096;integrated security=SSPI;data source=HECTOR;persist security info=False;initial catalog=Phuertos"
adappresentacion.AcceptChangesDuringFill = True
cmdpresentacion.CommandText = "select * from PRESENTACION"
cmdpresentacion.Connection = conexion
adappresentacion.SelectCommand = cmdpresentacion
Dim presentacion As DataRow
inspresentacion.CommandText = "insert into PRESENTACION(codpresentacion, tipo) values(@codpresentacion, @tipo)"
inspresentacion.Parameters.Add("@codpresentacion", SqlDbType.VarChar, 20, "codpresentacion")
inspresentacion.Parameters.Add("@tipo", SqlDbType.VarChar, 30, "tipo")
inspresentacion.Connection = conexion
adappresentacion.InsertCommand = inspresentacion
adappresentacion.Fill(dpresentacion, "tpresentacion")
presentacion = dpresentacion.Tables("tpresentacion").NewRow
presentacion("codpresentacion") = tcodigo.Text
presentacion("tipo") = ttipo.Text
dpresentacion.Tables("tpresentacion").Rows.Add(presentacion)
adappresentacion.Update(dpresentacion, "tpresentacion")
como lo puedo hacer para modificar?????
gracias de antemano
Dim conexion As New SqlClient.SqlConnection
Dim cmdpresentacion, inspresentacion As New SqlClient.SqlCommand
Dim adappresentacion As New SqlClient.SqlDataAdapter
Dim dpresentacion As New DataSet
conexion.ConnectionString = "workstation id=HECTOR;packet size=4096;integrated security=SSPI;data source=HECTOR;persist security info=False;initial catalog=Phuertos"
adappresentacion.AcceptChangesDuringFill = True
cmdpresentacion.CommandText = "select * from PRESENTACION"
cmdpresentacion.Connection = conexion
adappresentacion.SelectCommand = cmdpresentacion
Dim presentacion As DataRow
inspresentacion.CommandText = "insert into PRESENTACION(codpresentacion, tipo) values(@codpresentacion, @tipo)"
inspresentacion.Parameters.Add("@codpresentacion", SqlDbType.VarChar, 20, "codpresentacion")
inspresentacion.Parameters.Add("@tipo", SqlDbType.VarChar, 30, "tipo")
inspresentacion.Connection = conexion
adappresentacion.InsertCommand = inspresentacion
adappresentacion.Fill(dpresentacion, "tpresentacion")
presentacion = dpresentacion.Tables("tpresentacion").NewRow
presentacion("codpresentacion") = tcodigo.Text
presentacion("tipo") = ttipo.Text
dpresentacion.Tables("tpresentacion").Rows.Add(presentacion)
adappresentacion.Update(dpresentacion, "tpresentacion")
como lo puedo hacer para modificar?????
gracias de antemano
Valora esta pregunta


0