Hi all,
I'm new to C# and our forum.
I just start code in C#.
I'm using visual studio 2008 and oracle database9i.
I need a code data manipulation with oracle db. ie. I want to access the oracle table through datagridview[showdata/insert/update/delete].
1. How to Bind the data to datagridview using dataset.
2. How to insert/update/delete using dataset in a datagridview.
Can you give me the samples to start.
Thanks in advance,
thenndral
DataGridView - Show/Insert/Update/Delete
Page 1 of 14 Replies - 6764 Views - Last Post: 08 September 2011 - 12:18 PM
Replies To: DataGridView - Show/Insert/Update/Delete
#2
Re: DataGridView - Show/Insert/Update/Delete
Posted 06 September 2011 - 09:30 PM
Some code to chew on...
In the code above the source string will be your connection string information and selectString would be your select statement.
Enjoy!
OleDbConnection OracleConnection = new OleDbConnection(sourceString); // Create a DataAdapter OleDbDataAdapter OracleDataAdapter = new OleDbDataAdapter(selectString, OracleConnection); // Create the DataSet DataSet OracleDataSet = new DataSet(); // Fill the dataset and give it a table name OracleDataAdapter.Fill(OracleDataSet, "example_table"); // Now set the data source using that table name dataGrid.DataSource = OracleDataSet.Tables["example_table"];
In the code above the source string will be your connection string information and selectString would be your select statement.
Enjoy!
#3
Re: DataGridView - Show/Insert/Update/Delete
Posted 07 September 2011 - 05:58 AM
Have a look here: http://www.dreaminco...iew-using-c%23/
#4
Re: DataGridView - Show/Insert/Update/Delete
Posted 07 September 2011 - 09:56 PM
Thank you for your reply.
Its Help me to good start...
Here I attach my code, have a look and give your guidance.
1. after save data how to refresh datagridview.
2. how to update / delete from datagridview and at the same time it should be affect the table too...
After i finish this work, i want to start study.... 1 dataset into 2 or 3 tables...
thanks for all helps...
thenndral
Its Help me to good start...
Here I attach my code, have a look and give your guidance.
1. after save data how to refresh datagridview.
2. how to update / delete from datagridview and at the same time it should be affect the table too...
After i finish this work, i want to start study.... 1 dataset into 2 or 3 tables...
thanks for all helps...
thenndral
Attached File(s)
-
datagrid_changes.zip (43.37K)
Number of downloads: 417
#5
Re: DataGridView - Show/Insert/Update/Delete
Posted 08 September 2011 - 12:18 PM
To refresh my datagridview I first use (td is my DataTable)
and then I load my data again in it.
For your second question I can't help. I have trouble using a database myself, so I solved this with a .xls file with all my data in it, just like a database. Updating and Deleting a row in my database always failed.
dt.Clear();
and then I load my data again in it.
For your second question I can't help. I have trouble using a database myself, so I solved this with a .xls file with all my data in it, just like a database. Updating and Deleting a row in my database always failed.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|