Buenos días,
Tengo un formulario con varios campos (TextBox, BomboBox). Lo que quiero es
pasar el valor de estos campos a una fila nueva cuando le de a aceptar.
El código es el siguiente:
Private Sub Accept_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Accept.Click
Dim conn As New SqlConnection()
Dim Adapt As New SqlDataAdapter()
'Abre conexión con la base de datos de SQL Server
conn.ConnectionString = "Data Source=SQL;Initial
Catalog=Cartera_Ofertas;Persist Security Info=True;User
ID=is\Cartera;Password=ingeteam"
' Adapt.Update(dataRows()As System.Data.DataRow)As Integer
Dim newRow As Cartera_OfertasDataSet.ClientesRow =
Me.Cartera_OfertasDataSet.Clientes.NewRow()
newRow.Nombre = NombreTextBox
newRow.IdArea = IdAreaComboBox
newRow.Corporacion = CorporacionTextBox
newRow.Division = DivisionTextBox
newRow.Unidad_Gestion = Unidad_GestionTextBox
newRow.Ciudad = CiudadTextBox
newRow.Provincia = ProvinciaTextBox
newRow.Pais = PaisTextBox
Me.Cartera_OfertasDataSet.Clientes.Rows.Add(newRow)
MsgBox("Cliente Agregado", MsgBoxStyle.Information)
End Sub
ERROR QUE ME DA:
Un valor de tipo 'System.Windows.Forms.TextBox' no se puede convertir en
'String'
Un valor de tipo 'System.Windows.Forms.ComboBox' no se puede convertir en
'Integer'
Leer las respuestas