Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
How search from sql server ? c#

I have DB in SQL server management studio. The Employee has first_name, last_name, and department. The code in c#:

        private FactoryDBEntities db = new FactoryDBEntities();

    public List<Employee> GetEmployees(string fname,string lname, int department)
    {
        if (fname == "" && lname == "" && department == 0)
        {
            return db.Employee.ToList();
        }
        else if(fname!=""&& lname == "" && department == 0)
        {
          
            return db.Employee.Where(x => x.First_Name == fname).ToList();
        }
        else if(fname == "" && lname != "" && department == 0)
        {
            return db.Employee.Where(x => x.Last_Name == lname).ToList();
        }
        else
        {
            return db.Employee.Where(x => x.DepartmentID == department).ToList();
        }
        
    }

now I want to send from javascript to search but I don't know how I can send this.

for example from postman I send: https://localhost:44341/api/Employee?fname=John and I received the data that I want. Thanks.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You are looking for the Fetch API.

fetch('https://localhost:44341/api/Employee?fname=John')
  .then(response => response.json())
  .then(data => console.log(data));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!