C# : The Easy Way : How to Connect to SQL Server Database File (.mdf) in Visual Studio 2019



๐Ÿ‘จ‍๐Ÿซ Please watch the top 3 most popular videos on my channel.

๐Ÿฅ‡ 33 Million Views : Programming in Visual Basic .Net How to Connect Access Database to VB.NET : https://youtu.be/cwDqjmSmtMQ

๐Ÿฅˆ 13 Million Views : Visual Basic .Net : Search in Access Database - DataGridView BindingSource Filter (Part 1/2) : https://youtu.be/UoT2oava9ns

๐Ÿฅ‰ 2 Million Views : Visual Basic .Net : Search in Access Database - DataGridView BindingSource Filter (Part 2/2) : https://youtu.be/e5Dvkw7moWg

๐Ÿ’ฐ Donate $29 USD and Receive a free PDF Source Code of the above project:
https://www.paypal.com/paypalme/CodeAMinute/29USD
๐Ÿ“ง Contact the instructor via this email: ibasskung@gmail.com

✔ This project is also included: (Export Data To Excel): https://youtu.be/whwQWX4sR7Y

๐Ÿ’ก Premium Online Courses ๐Ÿ’ก

๐ŸŽ“ Master Visual Basic .NET and Access Database By Building the Point Of Sale System (POS)
๐Ÿ“ฒ Enroll Now: https://bit.ly/2WcbRhX

๐ŸŽ“ Learn C# and SQL Server 2019 by Building Windows Forms Application with ADO.NET
๐Ÿ“ฒ Enroll Now: https://bit.ly/37iLrRX

๐Ÿ“š See all courses here: https://bit.ly/2IJPxcm


๐Ÿš€ 4K UHD : Visual C# .NET Project : The Easy Way! - How to Connect to a SQL Server Database File (.mdf) in Visual Studio 2019 (Visual C# .NET .MDF Database Project).
๐ŸŽฆ Watch in 4K on YouTube: https://youtu.be/_cHmSLfsXOA

๐ŸŽ“ In this video tutorial you will learn step by step:
- How to Create a SQL Server database file (.mdf) in Visual Studio 2019.
- How to Connect to SQL Server Database file (.mdf) using Wizard (Without Writing Any Code!)
- How to Perform a Simple CRUD Operation using C# .NET and SQL Server database in less than 10 lines of code!
- How to Solve a Problem: TableAdapterManager.UpdateAll() not working.

๐Ÿš€ Visual Basic .NET version: https://youtu.be/z6W8-g6i-ZE


C# Source Code by iBasskung.


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;


namespace CSMDFDatabase

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }


        private void employeesBindingNavigatorSaveItem_Click(object sender, EventArgs e)

        {

            // <auto-generated> This code was generated by a tool.

            this.Validate();

            this.employeesBindingSource.EndEdit();

            this.tableAdapterManager.UpdateAll(this.myDatabaseDataSet);

            // </auto-generated>

        }


        private void Form1_Load(object sender, EventArgs e)

        {

            // TODO: This line of code loads data into the 'myDatabaseDataSet.Employees' table. You can move, or remove it, as needed.

            // <auto-generated> This code was generated by a tool.

            this.employeesTableAdapter.Fill(this.myDatabaseDataSet.Employees);

            // </auto-generated>

        }


        private void refreshToolStripButton_Click(object sender, EventArgs e)

        {

            this.employeesTableAdapter.Fill(this.myDatabaseDataSet.Employees);

        }


        private void closeButton_Click(object sender, EventArgs e)

        {

            // Note: This is a comment.

            // Close this window.

            this.Close();

        }


        private void previousButton_Click(object sender, EventArgs e)

        {

            bindingNavigatorMovePreviousItem.PerformClick();

        }


        private void NextButton_Click(object sender, EventArgs e)

        {

            bindingNavigatorMoveNextItem.PerformClick();

        }


        private void addNewButton_Click(object sender, EventArgs e)

        {

            bindingNavigatorAddNewItem.PerformClick();

        }


        private void saveButton_Click(object sender, EventArgs e)

        {

            employeesBindingNavigatorSaveItem.PerformClick();

        }


        private void deleteButton_Click(object sender, EventArgs e)

        {

            bindingNavigatorDeleteItem.PerformClick();

        }


    }

}


๐Ÿ“š See all courses here: https://www.udemy.com/user/tanin-sangngam


Follow me around

✔ Want to get updates on new courses or other cool free stuff? Just follow me on social media if that's your thing!

๐Ÿ“บ Pages:
๐Ÿ“ https://www.facebook.com/CodeAMinute
๐Ÿ“ https://www.facebook.com/IbasskungTutorial
๐Ÿ“ https://www.facebook.com/codewithibasskung
๐Ÿ“ https://www.facebook.com/iBasskungAcademy

๐Ÿ“บ YouTube:
๐Ÿ“ https://www.youtube.com/c/iBasskung

๐Ÿ“บ Udemy:
๐Ÿ“ https://www.udemy.com/user/tanin-sangngam

๐Ÿ“บ Twitter:
๐Ÿ“ https://twitter.com/IBasskung

๐Ÿ“บ Pinterest:
๐Ÿ“ https://www.pinterest.com/ibasskung

๐Ÿ“บ Blogger:
๐Ÿ“ .NET: https://codeaminute.blogspot.com
๐Ÿ“ JAVA: https://javacodeminutes.blogspot.com
๐Ÿ“ VBA: https://vbacodeminutes.blogspot.com

๐Ÿ’ฏ THANK YOU SO MUCH! ๐Ÿ’ฏ

#CSharp #VisualCSharp #FreeSourceCode #MDF #SQLServer #PointOfSale #POS #VisualStudio  

Comments