Question: Hello, I need your help with my program to implement a search function where user can search a list of information from a database using

Hello, I need your help with my program to implement a search function where user can search a list of information from a database using ASP.NET C#. Refer below:

Below are my codes:

products.cshtml

@{ var db = Database.Open("bakery"); var selectQueryString = "SELECT * FROM Product ORDER BY Name";

}

Products

Bakery Products


@foreach (var row in db.Query(selectQueryString)) { }
Name Description Price
@row.Name @row.Description @row.Price

----------------------------------------------------------------

Outputs:

Hello, I need your help with my program to implement a search

function where user can search a list of information from a database

Bakery Products Search: apple Name Apple Pie Description Price Second only to your mom's pie 12.99 Bakery Products Search: hello No records found. Bakery Products Search: apple Name Apple Pie Description Price Second only to your mom's pie 12.99 Bakery Products Search: hello No records found

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!