Data not updating on fields using UPDATE Statement
-
I have these fields set to the asp controls below:
string contnumber = contractnumber.Text;
string solnumber = solicitationnumber.Text;
string ordnumber = ordernumber.Text;
string contstartdate = contractstartdate.Value;
string contenddate = contractenddate.Value;
string solstartdate = solicitationstartdate.Value;
string solenddate = solicitationenddate.Value;
string soltype = solicitationtype.Text;
string pasnum = pasnumber.Text;
string commnts = comments.Text;
string contkind = contractkind.SelectedItem.Text;
string conttype = contracttype.SelectedItem.Text;
string ponum = ponumber.Text;
string instrtype = instrumenttype.SelectedItem.Text;
string totcontractamount = totalcontractamount.Text;
string estimloddate = estloddate.Value;
string contfirstname = contractfirstname.Text;
string contmiddleinit = contractmiddleinit.Text;
string contlastname = contractlastname.Text;
string lodsigned = datelodsigned.Value;
string contractid = contractinfoid.Text;when I open the form to update some of these fields the fields don't update when I step thru the code and obviously don't update using this update statement to the database:
OracleConnection conn = new OracleConnection(); // C#
conn.ConnectionString = strConnection;
conn.Open();OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "UPDATE CONTRACT\_INFO SET CONTRACT\_SELECTION = :contractselection, CONTRACT\_NUMBER = :contnumber, SOLICITATION\_NUMBER = :solnumber, ORDER\_SELECTION = :orderselection, ORDER\_NUMBER = :ordnumber, CONTRACT\_START\_PERIOD = to\_date(:contstartdate, 'MM/DD/YYYY'), CONTRACT\_END\_PERIOD = to\_date(:contenddate, 'MM/DD/YYYY'), SOLICITATION\_START\_DATE = to\_date(:solstartdate, 'MM/DD/YYYY'), SOLICITATION\_END\_DATE = to\_date(:solenddate, 'MM/DD/YYYY'), SOLICITATION\_TYPE = :soltype, SURVEY\_REQUESTED = :preaward, PAS\_NUMBER = :pasnum, COMMENTS = :commnts, CONTRACT\_KIND = :contkind, CONTRACT\_TYPE = :conttype, PO\_ASSOCIATED = :poselection, PO\_NUMBER = :ponum, INSTRUMENT\_TYPE = :instrtype, TOTAL\_CONTRACT\_AMOUNT = :totcontractamount, EST\_LOD\_COMPLETION\_DATE = to\_date(:estimloddate, 'MM/DD/YYYY'), FIRST\_NAME
-
I have these fields set to the asp controls below:
string contnumber = contractnumber.Text;
string solnumber = solicitationnumber.Text;
string ordnumber = ordernumber.Text;
string contstartdate = contractstartdate.Value;
string contenddate = contractenddate.Value;
string solstartdate = solicitationstartdate.Value;
string solenddate = solicitationenddate.Value;
string soltype = solicitationtype.Text;
string pasnum = pasnumber.Text;
string commnts = comments.Text;
string contkind = contractkind.SelectedItem.Text;
string conttype = contracttype.SelectedItem.Text;
string ponum = ponumber.Text;
string instrtype = instrumenttype.SelectedItem.Text;
string totcontractamount = totalcontractamount.Text;
string estimloddate = estloddate.Value;
string contfirstname = contractfirstname.Text;
string contmiddleinit = contractmiddleinit.Text;
string contlastname = contractlastname.Text;
string lodsigned = datelodsigned.Value;
string contractid = contractinfoid.Text;when I open the form to update some of these fields the fields don't update when I step thru the code and obviously don't update using this update statement to the database:
OracleConnection conn = new OracleConnection(); // C#
conn.ConnectionString = strConnection;
conn.Open();OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "UPDATE CONTRACT\_INFO SET CONTRACT\_SELECTION = :contractselection, CONTRACT\_NUMBER = :contnumber, SOLICITATION\_NUMBER = :solnumber, ORDER\_SELECTION = :orderselection, ORDER\_NUMBER = :ordnumber, CONTRACT\_START\_PERIOD = to\_date(:contstartdate, 'MM/DD/YYYY'), CONTRACT\_END\_PERIOD = to\_date(:contenddate, 'MM/DD/YYYY'), SOLICITATION\_START\_DATE = to\_date(:solstartdate, 'MM/DD/YYYY'), SOLICITATION\_END\_DATE = to\_date(:solenddate, 'MM/DD/YYYY'), SOLICITATION\_TYPE = :soltype, SURVEY\_REQUESTED = :preaward, PAS\_NUMBER = :pasnum, COMMENTS = :commnts, CONTRACT\_KIND = :contkind, CONTRACT\_TYPE = :conttype, PO\_ASSOCIATED = :poselection, PO\_NUMBER = :ponum, INSTRUMENT\_TYPE = :instrtype, TOTAL\_CONTRACT\_AMOUNT = :totcontractamount, EST\_LOD\_COMPLETION\_DATE = to\_date(:estimloddate, 'MM/DD/YYYY'), FIRST\_NAME
Did you mean to say "fields", or did you mean "local variables"? Fields (C# Programming Guide)[^] Variables and Constants[^] If you're using fields, you're doing it wrong. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Did you mean to say "fields", or did you mean "local variables"? Fields (C# Programming Guide)[^] Variables and Constants[^] If you're using fields, you're doing it wrong. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
I mean I'm setting the variables : string contnumber equal to the asp form control text box: contractnumber.Text. And then I set those variables equal to the database fields in the update statement to update the database. When I make changes to fields on this form (textboxes, dropdowns,etc.) and click Submit button the fields don't get updated to the database. That's the problem that I need help with.
-
I have these fields set to the asp controls below:
string contnumber = contractnumber.Text;
string solnumber = solicitationnumber.Text;
string ordnumber = ordernumber.Text;
string contstartdate = contractstartdate.Value;
string contenddate = contractenddate.Value;
string solstartdate = solicitationstartdate.Value;
string solenddate = solicitationenddate.Value;
string soltype = solicitationtype.Text;
string pasnum = pasnumber.Text;
string commnts = comments.Text;
string contkind = contractkind.SelectedItem.Text;
string conttype = contracttype.SelectedItem.Text;
string ponum = ponumber.Text;
string instrtype = instrumenttype.SelectedItem.Text;
string totcontractamount = totalcontractamount.Text;
string estimloddate = estloddate.Value;
string contfirstname = contractfirstname.Text;
string contmiddleinit = contractmiddleinit.Text;
string contlastname = contractlastname.Text;
string lodsigned = datelodsigned.Value;
string contractid = contractinfoid.Text;when I open the form to update some of these fields the fields don't update when I step thru the code and obviously don't update using this update statement to the database:
OracleConnection conn = new OracleConnection(); // C#
conn.ConnectionString = strConnection;
conn.Open();OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "UPDATE CONTRACT\_INFO SET CONTRACT\_SELECTION = :contractselection, CONTRACT\_NUMBER = :contnumber, SOLICITATION\_NUMBER = :solnumber, ORDER\_SELECTION = :orderselection, ORDER\_NUMBER = :ordnumber, CONTRACT\_START\_PERIOD = to\_date(:contstartdate, 'MM/DD/YYYY'), CONTRACT\_END\_PERIOD = to\_date(:contenddate, 'MM/DD/YYYY'), SOLICITATION\_START\_DATE = to\_date(:solstartdate, 'MM/DD/YYYY'), SOLICITATION\_END\_DATE = to\_date(:solenddate, 'MM/DD/YYYY'), SOLICITATION\_TYPE = :soltype, SURVEY\_REQUESTED = :preaward, PAS\_NUMBER = :pasnum, COMMENTS = :commnts, CONTRACT\_KIND = :contkind, CONTRACT\_TYPE = :conttype, PO\_ASSOCIATED = :poselection, PO\_NUMBER = :ponum, INSTRUMENT\_TYPE = :instrtype, TOTAL\_CONTRACT\_AMOUNT = :totcontractamount, EST\_LOD\_COMPLETION\_DATE = to\_date(:estimloddate, 'MM/DD/YYYY'), FIRST\_NAME
Debug the code and watch what is happening. You'll solve it in no time.
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.