C
Charlie Parker
Hi there,
I'm trying to recycle myself to VB.net. I'm trying to get this to work but
when I click the button a window pops up with "Could not find
ArgumentException" and "column 'reffactura' doesn't belong to the table".
Well my desktop language is spanish and in english this may differ a
little...
I have this:
Imports System.Data
Imports System.Data.SqlClient
Public Class Form2
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim GeoSQLConn As SqlClient.SqlConnection
GeoSQLConn = New SqlClient.SqlConnection()
GeoSQLConn.ConnectionString = "data source = DAVID-PORTATIL\David; initial
catalog = geoflux; integrated security = true"
GeoSQLConn.Open()
Dim GeoAdapter As SqlDataAdapter = New SqlDataAdapter("SELECT reffactura
FROM ordre", GeoSQLConn)
Dim GeoSet As DataSet = New DataSet()
GeoAdapter.Fill(GeoSet)
Dim GeoTable As DataTable = New DataTable()
Dim nouOrdre As DataRow = GeoTable.NewRow()
nouOrdre("reffactura") = RefFactura.Text
GeoTable.Rows.Add(nouOrdre)
GeoAdapter.Update(GeoTable)
GeoTable.AcceptChanges()
End Sub
End Class
What's wrong?
Thanks in advance
I'm trying to recycle myself to VB.net. I'm trying to get this to work but
when I click the button a window pops up with "Could not find
ArgumentException" and "column 'reffactura' doesn't belong to the table".
Well my desktop language is spanish and in english this may differ a
little...
I have this:
Imports System.Data
Imports System.Data.SqlClient
Public Class Form2
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim GeoSQLConn As SqlClient.SqlConnection
GeoSQLConn = New SqlClient.SqlConnection()
GeoSQLConn.ConnectionString = "data source = DAVID-PORTATIL\David; initial
catalog = geoflux; integrated security = true"
GeoSQLConn.Open()
Dim GeoAdapter As SqlDataAdapter = New SqlDataAdapter("SELECT reffactura
FROM ordre", GeoSQLConn)
Dim GeoSet As DataSet = New DataSet()
GeoAdapter.Fill(GeoSet)
Dim GeoTable As DataTable = New DataTable()
Dim nouOrdre As DataRow = GeoTable.NewRow()
nouOrdre("reffactura") = RefFactura.Text
GeoTable.Rows.Add(nouOrdre)
GeoAdapter.Update(GeoTable)
GeoTable.AcceptChanges()
End Sub
End Class
What's wrong?
Thanks in advance