Click here to Skip to main content
15,915,513 members
Home / Discussions / Database
   

Database

 
AnswerRe: OREIGN KEY REFERENCES? Pin
Chris Meech29-Nov-04 7:16
Chris Meech29-Nov-04 7:16 
GeneralUpdate Statement Pin
jlawren728-Nov-04 12:28
jlawren728-Nov-04 12:28 
GeneralRe: Update Statement Pin
Christian Graus28-Nov-04 13:48
protectorChristian Graus28-Nov-04 13:48 
GeneralRe: Update Statement Pin
Edbert P28-Nov-04 18:39
Edbert P28-Nov-04 18:39 
GeneralRe: Update Statement Pin
jlawren729-Nov-04 1:39
jlawren729-Nov-04 1:39 
GeneralRe: Update Statement Pin
Luis Alonso Ramos29-Nov-04 10:03
Luis Alonso Ramos29-Nov-04 10:03 
GeneralOleDB and Excel !! Pin
fadee28-Nov-04 9:53
fadee28-Nov-04 9:53 
GeneralRecords are applied double Pin
realmontanakid27-Nov-04 1:39
realmontanakid27-Nov-04 1:39 
Hi

Got a Problem with my Data Records. They'll be added double.
By onclick the Add Button the Records are double applied??
What's wrong with my Code?? It's an Access Database.

private void btAdd_Click(object sender, System.EventArgs e)
{
DataAdd();
}

public void DataAdd()
{
OleDbDataAdapter dbAdapter = new OleDbDataAdapter();
conn = new OleDbConnection(ConnectionString);
conn.Open();
string sql ="INSERT INTO tbl_Artikel (Rubrik, Artikel, Regal, Fach, Hersteller, Beschreibung , Preis, Datum, Bestellungsdatum, Lieferungsdatum, Garantie, Seriennr, Mitarbeiter, Verwendung, Lieferant) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
OleDbCommand icmd = new OleDbCommand(sql,conn);
dbAdapter.SelectCommand = icmd;

icmd.Connection=conn;
icmd.Parameters.Add("@Rubrik", OleDbType.VarChar, 50).Value = this.textBoxRubrik.Text;
icmd.Parameters.Add("@Artikel", OleDbType.VarChar, 50).Value =this.textBoxArtikel.Text;
icmd.Parameters.Add("@Regal", OleDbType.VarChar, 50).Value = this.textBoxRegal.Text;
icmd.Parameters.Add("@Fach", OleDbType.VarChar, 50).Value =this.textBoxFach.Text;
icmd.Parameters.Add("@Hersteller", OleDbType.VarChar, 50).Value =this.textBoxHersteller.Text;
icmd.Parameters.Add("@Beschreibung", OleDbType.VarChar, 50).Value =this.textBoxBeschreibung.Text;
icmd.Parameters.Add("@Preis", OleDbType.VarChar, 50).Value =this.textBoxPreis.Text;
icmd.Parameters.Add("@Datum", OleDbType.VarChar, 50).Value =this.textBoxDatum.Text;
icmd.Parameters.Add("@Bestellungsdatum", OleDbType.VarChar, 50).Value =this.textBoxBestellungsdatum.Text;
icmd.Parameters.Add("@Lieferungsdatum", OleDbType.VarChar, 50).Value =this.textBoxLieferungsdatum.Text;
icmd.Parameters.Add("@Garantie", OleDbType.VarChar, 50).Value =this.textBoxGarantie.Text;
icmd.Parameters.Add("@Seriennr", OleDbType.VarChar, 50).Value =this.textBoxSeriennr.Text;
icmd.Parameters.Add("@Mitarbeiter", OleDbType.VarChar, 50).Value =this.textBoxMitarbeiter.Text;
icmd.Parameters.Add("@Verwendung", OleDbType.VarChar, 50).Value =this.textBoxVerwendung.Text;
icmd.Parameters.Add("@Lieferant", OleDbType.VarChar, 50).Value =this.textBoxLieferant.Text;
icmd.ExecuteNonQuery();
DataSet DS = new DataSet();
dbAdapter.Fill(DS, "tbl_Artikel");
conn.Close();
}
GeneralRe: Records are applied double Pin
Colin Angus Mackay27-Nov-04 14:49
Colin Angus Mackay27-Nov-04 14:49 
GeneralRe: Records are applied double Pin
realmontanakid29-Nov-04 11:07
realmontanakid29-Nov-04 11:07 
GeneralModifying a Column Pin
si_6926-Nov-04 4:09
si_6926-Nov-04 4:09 
GeneralRe: Modifying a Column Pin
Mike Dimmick26-Nov-04 4:43
Mike Dimmick26-Nov-04 4:43 
GeneralRe: Modifying a Column Pin
si_6926-Nov-04 4:56
si_6926-Nov-04 4:56 
QuestionCan anyone help me Pin
EshaKarthikeyan26-Nov-04 3:20
EshaKarthikeyan26-Nov-04 3:20 
AnswerRe: Can anyone help me Pin
David Salter26-Nov-04 4:50
David Salter26-Nov-04 4:50 
GeneralContents of TextBoxes assign to sqlString Pin
realmontanakid25-Nov-04 23:27
realmontanakid25-Nov-04 23:27 
GeneralRe: Contents of TextBoxes assign to sqlString Pin
Colin Angus Mackay26-Nov-04 0:35
Colin Angus Mackay26-Nov-04 0:35 
GeneralSession Data in SQL Server Pin
David Salter25-Nov-04 22:41
David Salter25-Nov-04 22:41 
QuestionHow to import data from different catalog via dts Pin
steven_wong25-Nov-04 21:14
steven_wong25-Nov-04 21:14 
GeneralBoolean Field Pin
Sebastien Lachance25-Nov-04 5:38
Sebastien Lachance25-Nov-04 5:38 
QuestionIs ObjectSpaces any good ? Pin
Andres Coder25-Nov-04 4:34
Andres Coder25-Nov-04 4:34 
GeneralQuestion on Dataset v.s DataReader Pin
HahnTech25-Nov-04 4:20
HahnTech25-Nov-04 4:20 
GeneralRe: Question on Dataset v.s DataReader Pin
Steven Campbell25-Nov-04 5:04
Steven Campbell25-Nov-04 5:04 
GeneralDataGrid in a second Form Pin
realmontanakid25-Nov-04 3:31
realmontanakid25-Nov-04 3:31 
GeneralRe: DataGrid in a second Form Pin
Edbert P25-Nov-04 15:50
Edbert P25-Nov-04 15:50 

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.