B
Brian Conway
Can anyone give me a quick little break down of what I would need to do to
insert information into a database onClick of and Submit button? I am new
to all of this and have done it with datagrids, but want to do it with just
textboxes filled in and on click of the Submit button that it would take
those boxes and insert a record into the database. This is for C#. below
is a little of what I have on the submit button but I don't think it is
correct.
private void btnSubmit_Click(object sender, System.EventArgs e)
{
this.oleDbInsertCommand1.CommandText = @"INSERT INTO
CONFERENCE.REQUEST(CUID, REQ_NUM, REQ_TYPE, CREATE_DT, START_DT, END_DT,
START_TM, END_TM, REQ_TTL, ATTENDEE_QTY, SETUP_DT, SETUP_TM, REQ_DESC,
CATERING_IND, WALK_THRU_IND, STORAGE_IND, BREAKOUT_RM_IND, MATERIALS_IND,
SPECIAL_REQ_TXT, REQ_STATUS, UPDATE_DT, UPDATED_BY_CUID,
CARD_EXPIRATION_VALUE, CHARGE_CD, BILL_METHOD_CD) VALUES (?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
this.oleDbInsertCommand1.Connection = this.oleDbConnection1;
this.oleDbInsertCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("CUID",
System.Data.OleDb.OleDbType.VarChar, 8, "CUID"));
this.oleDbInsertCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("REQ_NUM",
System.Data.OleDb.OleDbType.Decimal, 0,
System.Data.ParameterDirection.Input, false, ((System.Byte)(10)),
((System.Byte)(0)), "REQ_NUM", System.Data.DataRowVersion.Current, null));
insert information into a database onClick of and Submit button? I am new
to all of this and have done it with datagrids, but want to do it with just
textboxes filled in and on click of the Submit button that it would take
those boxes and insert a record into the database. This is for C#. below
is a little of what I have on the submit button but I don't think it is
correct.
private void btnSubmit_Click(object sender, System.EventArgs e)
{
this.oleDbInsertCommand1.CommandText = @"INSERT INTO
CONFERENCE.REQUEST(CUID, REQ_NUM, REQ_TYPE, CREATE_DT, START_DT, END_DT,
START_TM, END_TM, REQ_TTL, ATTENDEE_QTY, SETUP_DT, SETUP_TM, REQ_DESC,
CATERING_IND, WALK_THRU_IND, STORAGE_IND, BREAKOUT_RM_IND, MATERIALS_IND,
SPECIAL_REQ_TXT, REQ_STATUS, UPDATE_DT, UPDATED_BY_CUID,
CARD_EXPIRATION_VALUE, CHARGE_CD, BILL_METHOD_CD) VALUES (?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
this.oleDbInsertCommand1.Connection = this.oleDbConnection1;
this.oleDbInsertCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("CUID",
System.Data.OleDb.OleDbType.VarChar, 8, "CUID"));
this.oleDbInsertCommand1.Parameters.Add(new
System.Data.OleDb.OleDbParameter("REQ_NUM",
System.Data.OleDb.OleDbType.Decimal, 0,
System.Data.ParameterDirection.Input, false, ((System.Byte)(10)),
((System.Byte)(0)), "REQ_NUM", System.Data.DataRowVersion.Current, null));