Make a database management system for survey (part-3)

it is the continuation of a previous post.

here i will show how the various types of search show in c# for oracle

To show all table n a gridview, we have to write below code  .

string selected = "select * from " + tableName;
DataSet dataSet = new DataSet();
OracleDataAdapter dataAdapt = new OracleDataAdapter(selected, oracleConect);
dataAdapt.Fill(dataSet, tableName);
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = dataSet;
dataGridView1.DataMember = tableName;

Show data depend on user modification u can use code like
tableName = "ALLC";
string MI = numericUpDown3.Value.ToString();
string MA = numericUpDown4.Value.ToString();
string selected = "select * from " + tableName + " WHERE SALARY >= " + MI + " AND SALARY <= " + MA;
DataSet dataSet = new DataSet();
OracleDataAdapter dataAdapt = new OracleDataAdapter(selected, oracleConect);
dataAdapt.Fill(dataSet, tableName);
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = dataSet;
dataGridView1.DataMember = tableName;

Advertisements

About kishordgupta

A software developer
This entry was posted in C#, DATABASE, Winform app and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s