-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDAL.cs
49 lines (43 loc) · 1 KB
/
DAL.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
44
45
46
47
48
49
using System;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;
/// <summary>
/// Summary description for DAL
/// </summary>
public class DAL
{
public SqlConnection con;
public DAL()
{
con = new SqlConnection(WebConfigurationManager.ConnectionStrings["cs"].ConnectionString);
}
public void getall(SqlCommand a)
{
con.Open();
a.ExecuteNonQuery();
con.Close();
}
public void gelalltrans(SqlCommand abc, SqlTransaction tran)
{
//con.Open();
//con.BeginTransaction();
try
{
abc.ExecuteNonQuery();
tran.Commit();
}
catch
{
tran.Rollback();
}
con.Close();
}
public DataTable getfilterdata(SqlCommand abc)
{
SqlDataAdapter da = new SqlDataAdapter(abc);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}