public DataSet ConnectExample()
{
try
{
string theConnectionString = @"Server=" + SERVER + ";Database=" +
DatabaseName + ";User ID=" + UserName + ";Password=" + Password +
";Trusted_Connection=False;";
string theSQL = "SELECT * FROM ExampleDatabase";
SqlConnection thisConnection = new SqlConnection(theConnectionString);
SqlDataAdapter theDataAdapter = new SqlDataAdapter(theSQL, thisConnection);
DataSet thisDataSet = new DataSet();
theDataAdapter.Fill(thisDataSet, "ExampleDB");
thisConnection.Close();
return thisDataSet;
}
catch (Exception ex)
{
return null;
}
}