In this article i will show you, How to display image from database in ASP.NET MVC. To do this task, we will use <img /> tag in view section. First of all, Create a connection with the database using Entity Data model (Learn How to use ADO.NET Entity Data Model). In the controller action method pass the list of data to the view. Like that:
private DatabaseEntities db = new DatabaseEntities();
// GET: Home
public ActionResult Index()
{
return View(db.Employees.ToList());
}
In this article i will show you how to delete selected item from DropdownList/Select List Using JQuery. We all know that select/DropdownList contain option tag for value. So, the main logic behind the question is first to get the select list by using their id property then use option tag with selected attribute after that remove.
In this video i will explain you how to delete row from GridView as well as Database in ASP.NET C#. The main logic behind the code is CommandName, i.e predefined in asp.net library. If you want to update row then you have a Update command Name similarly if you want to delete row from GridView then you have Delete command Name and their respective event. Keep watching and learn better.
ADO.NET Entity Data Model provides you a better and fast approach for communicating with database objects like Table, Stored Procedure etc. After added it, you have some models (classes ) which is related to tables and context classes. I mean to say that you can access database table directly by using context classes. In the context class, we have some public properties, through these we can retrieve table values. These all such things are related to model first approach , i mean to day that ADO.NET Entity Data model is based on model first approach. Let's start to configure it with the database, you can follow these steps , if you want to configure it:
Step-1 : Right Click on your project name , select add new item from the appearing menu.
Step-2 :
Step-3: Press "OK" to continue.
Step-4: Select "EF designer from Database" option in the Entity Data Model wizard.
Step-5: Now, press Next to continue in model wizard, select Connection string from Dropdown menu if exists. You can create "New Connection" by using Sql Server Database.
Step-6: Also select "Save Connection String into web.config file" CheckBox to save your whole connection parameter in web.config file.
Step-7: Press "Next" to continue. Select either all of them Table, Views, Stored processor and one of them.
In this article, I will show you, How to add default item at index 0 in DropdownList, also select default item, default item will be disabled when drop down the popup. For this task, first of all bind the DropdownList then you can add default item at index first by using following line of code:
DropDownList1.Items.Insert(0, "Select");
After that you can select or disabled default item by the following line of code:
In this Project we have a logical system. By using this system we can store courses and their subjects in the system database. The all things we can do by administrator. First of all, administrator do login in the system. He/ She can change our profile like change password, username and etc. In the Courses tab, we will provide some following things like "Manage Courses", "Add Courses", "Manage subject combination" and "Add subject combination". In the section of Manage courses, i will provide you a GridView control with the following action control like:
By using Edit and Delete button we can make some changes in the course table. By using Subject combination we can configure subjects under defined courses. I will provide you a interface through which you can add new courses in the table like :
After add course details , you can add subjects in particular course also configure it by using some action command like "Edit" and "Delete". Now, by mentioned snap, you can add new subject details in the courses like:
Through this project we are booking a hotel room in a city also reduce lots of paper work. Actually physical process converted into logical process or you can say online process.
In this project we will provide such types of searching functionality:
Pick random city
Search city
You can search hotel directly
Module of the project :
Visitor
Administrator
Working of the project
First of all visitor choose the hotel city by the help of searching facilities. In the search result we will provide some basic information about each hotel which is exist in the city. When visitor select a specific hotel in the given list, we will provide the full details of selected hotel with "book now" button. When visitor press this button, the system will check that visitor is whether authenticated or not. If visitor is not authenticated then visitor moves to the login page. Login page contain a link of register page. If visitor not a website user then she/he will not login by the login panel so first of all visitor should member of the website. After that he /she will booked the selected hotel.