I am new to C# and have a question regarding filtering of data. I have created a poject with a single form. In the project I added a Data Source with a data set to a single table in my database.
I then dropped the Details of the data set on my form which gave me textboxes for each column and also added a navigation bar to the form. When I run the form the data is as expected and I can add, delete, and edit the records.
My questions is can I filter the data based on a particular column and it contents?
I have read a lot about using Select and have tried to use it to no avail.
This is the code that loads the data, added automatically for me:
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dSLogin.Login' table. You can move, or remove it, as needed.
this.loginTableAdapter.Fill(this.dSLogin.Login);
}
I added a button to try to execute some sort of filter and here is the code I have for that - it does not produce an error but also does not filter the data.
private void button1_Click(object sender, EventArgs e)
{
this.dSLogin.Login.Select("TechName = 'E Andres'", "TechName", DataViewRowState.CurrentRows);
}
Any help is appreciated.
Ed
I then dropped the Details of the data set on my form which gave me textboxes for each column and also added a navigation bar to the form. When I run the form the data is as expected and I can add, delete, and edit the records.
My questions is can I filter the data based on a particular column and it contents?
I have read a lot about using Select and have tried to use it to no avail.
This is the code that loads the data, added automatically for me:
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dSLogin.Login' table. You can move, or remove it, as needed.
this.loginTableAdapter.Fill(this.dSLogin.Login);
}
I added a button to try to execute some sort of filter and here is the code I have for that - it does not produce an error but also does not filter the data.
private void button1_Click(object sender, EventArgs e)
{
this.dSLogin.Login.Select("TechName = 'E Andres'", "TechName", DataViewRowState.CurrentRows);
}
Any help is appreciated.
Ed