Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi everyone!
I have a question about a topic of WPF and C#

In my project have the following controls:
http://subirimagen.me/uploads/20180529170428.PNG

I need get serial number of the database of SQL when I press the Search button, but this should be identical to name of the textbox of user. In this project I use Entity Framework 6.

In SQL the query is similar to:
select serial_number from dbo
where [txtUser] == name_user


Could explain me a method for this case?

What I have tried:

Try search some methods but not work in my project.
Posted
Updated 29-May-18 15:47pm

1 solution

You can use LINQ

var filteredData = db.SerialNumbers
                     .Where(x => x.serial_number.Contains(this.FilterTextBox.Text));
 
Share this answer
 
Comments
alejandroGS 30-May-18 12:38pm    
Thanks for your help!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900