43 lines
1.0 KiB
C#

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 RODBInterface
{
public partial class InputBox : Form
{
private string _ResultConnectString = null;
public string ResultConnectString
{
get { return _ResultConnectString; }
set { _ResultConnectString = value; }
}
public InputBox(string constring)
{
InitializeComponent();
this.tbSqlConnectString.Text = constring;
}
private void btnTestConnect_Click(object sender, EventArgs e)
{
bool canConnect = SqlRODB.TestConnect(this.tbSqlConnectString.Text);
if (!canConnect)
MessageBox.Show("Connection failed.", "Connection Failed");
else
MessageBox.Show("You have been successfully connected to the database!", "Connection Succeeded");
}
private void btnOk_Click(object sender, EventArgs e)
{
ResultConnectString = this.tbSqlConnectString.Text;
}
}
}