Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
data grids
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Michelle Bronson
18y
1.7k
1
Reply
I am brand new to C#.net develper.
I have a windows form with a
data grid
on it. I am getting the data from an
Oracle
Database. I am able to display the data from the database on the data grid when a button is clicked. But what I need to do is enter 3 items (company, cons number, and year) into 3 text boxes and then when the button is clicked I only want to pull the data from the database where the company, cons number, and year match what was entered into the text boxes. Any help would be wonderful!!!!
public bool fnGetDataConnection()
{
try
{
con =new OleDbConnection(conString);
dAdapter=new OleDbDataAdapter("select * from forecast_exec_dir", con);
dSet=new DataSet();
//refreshes rows in the DataSet
dAdapter.Fill(dSet,"forecast_exec_dir");
}
catch(Exception ex)
{
MessageBox.Show("Error : "+ex.Message);
//connectection failed
return false;
} //try-catch
//connection ok!
return true;
}
private void btFind_Click(object sender,
System
.EventArgs e)
{
if (this.fnGetDataConnection())
{
this.dataGrid1.ReadOnly=true;
{
this.dataGrid1.DataSource=dSet.Tables["forecast_exec_dir"];
fnGetDataBindingForTextBoxes();
fnSetCurrencyManager();
fnDisplayRecordNumbers();
}
}
else
{
MessageBox.Show("Connection failed...");
Application.Exit();
}
}
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Invoking PPC Emulator
Programming Music Devices