Link to home
Start Free TrialLog in
Avatar of csharp_learner
csharp_learnerFlag for Singapore

asked on

Fill DataGridView into Oracle database C#

Hi,
My goal for this is to Update a Database table in Oracle with a DataGridView.
I have a datagridview1 containing the same column as the Oracle database.

I stuck @ how to fill the datatable with the DataGridView and Deleting everything from the current Oracle Database and insert the New DataTable.
OracleCommand oraclecmd = new OracleCommand("SELECT * FROM LOCATION", localConnection);
                        oracleda.SelectCommand = oraclecmd;
                        DataTable oracledt = new DataTable();
                       //Fill DataTable with datagridview1
                        oracleda.Fill(oracledt);
                       //Delete everything from existing data then insert
                        oracleda.Update(oracledt);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of schwertner
schwertner
Flag of Antarctica image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial