using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace Trpg{ public partial class TRPG : Form { //inserting class for sql connect here public class Connect { SqlConnection tconnect; public object TRPGConnect() { tconnect = new SqlConnection(@"server = .\sqlexpress;integrated security = true ;database = trpg"); return tconnect; } } //end of sql connect class here // create an instance of the connection. Connect trpgc = new Connect(); public TRPG() { InitializeComponent(); } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); } private void TRPG_Load(object sender, EventArgs e) { } public void testConnect() { tconnect.Open(); tconnect.Close(); }}}