ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/AnywhereTS-MSSQL/trunk/TSControlPanel/frmConfigureControlPanel.cs
Revision: 4
Committed: Wed Jul 11 14:19:13 2012 UTC (11 years, 2 months ago) by william
File size: 1569 byte(s)
Log Message:
imported from https://anywherets.svn.sourceforge.net/svnroot/anywherets/trunk/
Revision: 1
Author: beartown
Date: 3:10:40 AM, Monday, June 21, 2010
Message:
First upload. Still todo in order to get a fully working product: Replace Thinstation images with vanilla Thinstation, modify ImageDesigntimeConfig.cs, ImageRuntimeConfig.cs in order to support the Thinstation image

File Contents

# Content
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Text;
7 using System.Windows.Forms;
8 using System.Data.SqlClient;
9
10 namespace AnywhereTS
11 {
12 public partial class frmConfigureControlPanel : Form
13 {
14 public frmConfigureControlPanel()
15 {
16 InitializeComponent();
17 }
18
19 private void btnOk_Click(object sender, EventArgs e)
20 {
21 // Validate database server
22 string dataServer;
23 dataServer = textInput.Text.Trim();
24 //Create a connection to SQL Server
25 SqlConnection sqlCon = new SqlConnection();
26 try
27 {
28 sqlCon.ConnectionString = @"Data Source=" + dataServer + @"\SQLEXPRESS;Database='AnywhereTS';Integrated Security=True;Connect Timeout=30;User Instance=False";
29 sqlCon.Open();
30 }
31 catch (SqlException sql_ex)
32 {
33 MessageBox.Show("Could not connect to the datbase server. Please check your spelling and your connections. SQL Server Express error:\n" + sql_ex.Number.ToString() + " " + sql_ex.Message.ToString());
34 return;
35 }
36
37
38 // Save database server to variable and registry
39 ProSupport.strDatabaseServer = textInput.Text;
40 ATSGlobals.SetATSRegValue(ProSupport.strRegDatabaseServer, ProSupport.strDatabaseServer);
41
42 DialogResult = DialogResult.OK; //return
43 }
44 }
45 }