-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbcls.cs
43 lines (39 loc) · 898 Bytes
/
dbcls.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
/// <summary>
/// Summary description for dbcls
/// </summary>
public class dbcls
{
public dbcls()
{
//
// TODO: Add constructor logic here
//
}
public static SqlConnection CONN()
{
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["SQLCON"]);
if (con.State == System.Data.ConnectionState.Closed)
{
con.Open();
}
else
{
con.Close();
}
return con;
}
public static DataTable RETURN_DT(string QUERY)
{
DataTable dt = new DataTable();
SqlDataAdapter ada = new SqlDataAdapter(QUERY,CONN());
ada.Fill(dt);
return dt;
}
}