Posted On: Oct 16, 2020
The "using" statement in C# is used to import a namespace.
The following coding is coded:
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;
To close a running connection efficiently. The following coding is used:
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;
namespace WindowsFormsApp1 { public partial class Form1: Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { String constr = “Provider=Microsoft.ACE.OLEDB.12.0;} + “Data Source=***” + “Jet OLEDB: Database Password=***”; using (OLEDBConnection con = new OLEDBConnection (constr)) { con.Open(); MessageBox.Show(“Connection is Opened!); } } } }
Never Miss an Articles from us.
ADO.net is an acronym for ActiveX Data Objects, which is commonly used as a part of the .net framework...
Two of the most important objects of ADO.net are the DataReader and DataSet...
Some of the common data providers for ADO.net framework include:..