Me.cn = New Npgsql.NpgsqlConnection("Server=localhost;Port=5432;User Id=xxx;Password=xxx;Database=WaWi;") 'Fill dtPersonen Me.com = New NpgsqlCommand("SELECT * FROM public.Personen;", Me.cn) Me.daPersonen = New NpgsqlDataAdapter(Me.com) Me.combuiPersonen = New NpgsqlCommandBuilder(Me.daPersonen) Me.dtPersonen = New DataTable Me.dtPersonen.Columns.Add("ID", GetType(Int64)) Me.dtPersonen.PrimaryKey = New DataColumn() {Me.dtPersonen.Columns("ID")} Me.dtPersonen.Columns("ID").AllowDBNull = False Me.dtPersonen.Columns("ID").Unique = True Me.dtPersonen.Columns("ID").AutoIncrement = True Me.dtPersonen.Columns("ID").AutoIncrementSeed = GetHighestID("Personen") Me.daPersonen.Fill(Me.dtPersonen) Public Sub DatenbankSpeichern() Try Me.daPersonen.Update(Me.dtPersonen) Me.daKategorien.Update(Me.dtKategorien) Catch ex As Exception frmMain.Log.WriteErrorLog(ex) End Try End Sub
DER FEHLER:
Zitat
28.06.2006 15:29:06: Error: 42601: syntax Error at Or near ":" -------- bei System.Data.Common.DbDataAdapter.UpdatedRowStatusE
rrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
bei System.Data.Common.DbDataAdapter.UpdatedRowStatus(
RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
bei System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
bei System.Data.Common.DbDataAdapter.UpdateFromDataTab
le(DataTable dataTable, DataTableMapping tableMapping)
bei System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
bei WaWi.clsDatabase.DatenbankSpeichern() in C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\WaWi\WaWi\clsDatabase.vb:Zeile 75.
rrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
bei System.Data.Common.DbDataAdapter.UpdatedRowStatus(
RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
bei System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
bei System.Data.Common.DbDataAdapter.UpdateFromDataTab
le(DataTable dataTable, DataTableMapping tableMapping)
bei System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
bei WaWi.clsDatabase.DatenbankSpeichern() in C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\WaWi\WaWi\clsDatabase.vb:Zeile 75.
Dieser Beitrag wurde von mo bearbeitet: 29. Juni 2006 - 16:51