I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Introduction
In this article we will learn how to connect access database to windows form application. Get the MS Access data in windows form application. Access is a database system or you can its a tool of MS-Office. Through this we can store data permanently in it. If you want to store data in it by the help of windows application then you should connect it with the application.
Description
If you want to connect the database with the windows form application then you must to install the MS- Access in the computer. Also must to install connection drivers properly. Now, follow the instruction to connect ms-access database to windows form c#.
using System;
In this article we will learn how to connect access database to windows form application. Get the MS Access data in windows form application. Access is a database system or you can its a tool of MS-Office. Through this we can store data permanently in it. If you want to store data in it by the help of windows application then you should connect it with the application.
Description
If you want to connect the database with the windows form application then you must to install the MS- Access in the computer. Also must to install connection drivers properly. Now, follow the instruction to connect ms-access database to windows form c#.
- First to prepare a database file in MS-Access.
- Add a windows form project Using Visual Studio 2013 or earlier.
- Add a Method just after Initializing Component. Like
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Configuration;
namespace ConnectAccessDatabase
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
loadgrid();
}
private void loadgrid()
{
OleDbConnection con = new OleDbConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["Connection"].ToString();
con.Open();
MessageBox.Show("Connection Sucess");
}
}
}
Comments
Post a Comment