Welcome aboard! We are happy you are here and wish you good net-raft!
using System;
using System.Windows.Forms;
using System.Data.OleDb;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string connetionString = null;
OleDbConnection cnn ;
connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourdatabasename.mdb;";
cnn = new OleDbConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show ("The connection is open!");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show("The connection is refused!");
}
}
}
}
The most helpful C# solutions
detect ie C#C# Click to see more ... 4.7K 853