I am trying to add a new record into the database.
The code was initially
rsGroup.Open(ftSQL, Global.gADOConnection, false);
rsGroup.AddNew();
rsGroup["PANELIST_NUM"] = flPanelistNum;
rsGroup["USER_CREATED"] = Global.glUserNumberID;
With the initial error happening on the rsGroup.AddNew() being - Column PANELIST_NUM does not allow nulls.
This is because it is the Primary Key.
To fix this I tried to use an insert method-
strInsert1 = "INSERT INTO PANELIST_HEADER (PANELIST_NUM, USER_CREATED) VALUES (" + flPanelistNumber + "," + Global.glUserNumberID + ")";
System.Data.OracleClient.OracleCommand cmdCommand = new
System.Data.OracleClient.OracleCommand();
cmdCommand.CommandText = strInsert1;
cmdCommand.Connection = Global.gADOConnection;
cmdCommand.ExecuteNonQuery();
When I run this I do not get an error but it goes on in an infinite loop and never makes it to the next line of code after the ExecuteNonQuery Command. Is there a reason why it is stuck in a loop and/or is there another way for me to successfully add this record to the database?