Click here to Skip to main content
15,889,863 members
Home / Discussions / Database
   

Database

 
AnswerRe: Insert Record using ado.net Pin
Colin Angus Mackay26-Nov-05 1:22
Colin Angus Mackay26-Nov-05 1:22 
QuestionVB .NET 2005 Access Database Pin
kenexcelon25-Nov-05 17:21
kenexcelon25-Nov-05 17:21 
AnswerRe: VB .NET 2005 Access Database Pin
Paul Conrad28-Nov-05 11:48
professionalPaul Conrad28-Nov-05 11:48 
GeneralRe: VB .NET 2005 Access Database Pin
kenexcelon29-Nov-05 14:01
kenexcelon29-Nov-05 14:01 
GeneralRe: VB .NET 2005 Access Database Pin
Paul Conrad30-Nov-05 6:31
professionalPaul Conrad30-Nov-05 6:31 
QuestionHyperlinks Pin
Jkkenzie25-Nov-05 12:45
Jkkenzie25-Nov-05 12:45 
QuestionAnyone else hate the templates in SQL 2005 Pin
gantww25-Nov-05 10:08
gantww25-Nov-05 10:08 
QuestionDatatable insert Problem [2.0] Pin
AndySummer25-Nov-05 2:13
AndySummer25-Nov-05 2:13 
Hello everybody,

I have a little (for me big Cry | :(( ) problem.
I try to insert Data into Access with a DataTable, but everytime it throws an error when I update

System.Data.OleDb.OleDbException was unhandled
Message="Syntaxfehler in der INSERT INTO-Anweisung."
Source="Microsoft JET Database Engine"
ErrorCode=-2147217900
StackTrace:
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
.....


[CSHARP]

public void InsertArtikelToInventur(string ean, long Menge, string lagerplatz, long Nr_Filiale)
{
string l_krit;
string sql = "";
l_krit = "Artikelnummer=\"" + ean + "\"";
object l_ret = dlookup("Nr", "Artikel", l_krit);
if (l_ret != null)
{
sql = "SELECT INVENTURSTAND.Nr_Artikel, INVENTURSTAND.Datum, INVENTURSTAND.Menge, INVENTURSTAND.aktuell, INVENTURSTAND.Alter, INVENTURSTAND.Nr, INVENTURSTAND.Lager, INVENTURSTAND.Lagerplatz, INVENTURSTAND.Nr_Adresse_Lager FROM INVENTURSTAND";

OleDbCommand myOleDbCommand = new OleDbCommand(sql, connection);
OleDbDataAdapter myOleDbDataAdapter = new OleDbDataAdapter(myOleDbCommand);
DataTable dt = new DataTable();
OleDbCommandBuilder myOleCB = new OleDbCommandBuilder(myOleDbDataAdapter);
// myOleDbDataAdapter.InsertCommand = myOleCB.GetInsertCommand();

myOleDbDataAdapter.Fill(dt);

DataRow dr = dt.NewRow();
dr["Nr_Artikel"] = (int)l_ret;
dr["Datum"] = DateTime.Now;
dr["Menge"] = Menge;

dt.Rows.Add(dr);
myOleDbDataAdapter.Update(dt);
}
}


[/CSHARP]
AnswerRe: Datatable insert Problem [2.0] Pin
ventomito26-Nov-05 6:42
ventomito26-Nov-05 6:42 
Questionuser instance login flag Pin
Lebanese25-Nov-05 1:35
Lebanese25-Nov-05 1:35 
AnswerRe: user instance login flag Pin
enjoycrack26-Nov-05 8:36
enjoycrack26-Nov-05 8:36 
GeneralRe: user instance login flag Pin
Lebanese27-Nov-05 20:21
Lebanese27-Nov-05 20:21 
GeneralRe: user instance login flag Pin
enjoycrack27-Nov-05 20:35
enjoycrack27-Nov-05 20:35 
GeneralRe: user instance login flag Pin
Lebanese27-Nov-05 22:42
Lebanese27-Nov-05 22:42 
QuestionReporting Services Pin
mipooo24-Nov-05 22:01
mipooo24-Nov-05 22:01 
QuestionA Slightly Different Master Detail Problem Pin
TofuBug2424-Nov-05 20:20
TofuBug2424-Nov-05 20:20 
Questionusing the osql command Pin
dundealing24-Nov-05 8:40
dundealing24-Nov-05 8:40 
AnswerRe: using the osql command Pin
Rob Graham24-Nov-05 15:16
Rob Graham24-Nov-05 15:16 
AnswerRe: using the osql command Pin
Arjan Einbu25-Nov-05 12:57
Arjan Einbu25-Nov-05 12:57 
GeneralRe: using the osql command Pin
dundealing27-Nov-05 6:51
dundealing27-Nov-05 6:51 
AnswerRe: using the osql command Pin
Arjan Einbu27-Nov-05 23:03
Arjan Einbu27-Nov-05 23:03 
Questionmanaged or unmanaged Pin
John L. DeVito24-Nov-05 6:10
professionalJohn L. DeVito24-Nov-05 6:10 
AnswerRe: managed or unmanaged Pin
Mike Dimmick24-Nov-05 12:54
Mike Dimmick24-Nov-05 12:54 
QuestionmySQL 4.0 vs mySQL 5.0 Pin
JKallen24-Nov-05 6:00
JKallen24-Nov-05 6:00 
QuestionSQL Convertion of 0 Pin
Brendan Vogt23-Nov-05 2:19
Brendan Vogt23-Nov-05 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.