<%
Dim StrConn As String
Dim Sql As String
StrConn = WebConfigurationManager.ConnectionStrings("conn").ConnectionString
Dim Conn As New SqlConnection(StrConn)
Conn.Open()
Dim a, b, c, d, f, g, h, i As Integer
Sql = "SELECT sum(sale_60)As totals_60 FROM Dtac_sale , Dtac_back where month(Dtac_sale.date_now)= " & month.Text & " AND year(Dtac_sale.date_now)= " & year.Text & " "
Dim sqlCom As New SqlCommand(Sql, Conn)
Dim dr As SqlDataReader = sqlCom.ExecuteReader
While dr.Read
a = dr.Item("sale_60")
b = dr.Item("sale_100")
c = dr.Item("sale_200")
d = dr.Item("sale_300")
f = dr.Item("back_60")
g = dr.Item("back_100")
h = dr.Item("back_200")
i = dr.Item("back_300")
Session("z") = Session("z") + a
Session("y") = Session("y") + b
Session("x") = Session("x") + c
Session("w") = Session("w") + d
Session("v") = Session("v") + f
Session("u") = Session("u") + g
Session("t") = Session("t") + h
Session("s") = Session("s") + i
End While
%>
Dim StrConn As String
Dim Sql As String
StrConn = WebConfigurationManager.ConnectionStrings("conn").ConnectionString
Dim Conn As New SqlConnection(StrConn)
Conn.Open()
Dim a, b, c, d, f, g, h, i As Integer
Sql = "SELECT * FROM Dtac_sale where month(Dtac_sale.date_now)= " & Month.Text & " AND year(Dtac_sale.date_now)= " & Year.Text & " "
Dim sqlCom As New SqlCommand(Sql, Conn)
Dim dr As SqlDataReader = sqlCom.ExecuteReader
While dr.Read
a = dr.Item("sale_60")
b = dr.Item("sale_100")
c = dr.Item("sale_200")
d = dr.Item("sale_300")
f = dr.Item("back_60")
g = dr.Item("back_100")
h = dr.Item("back_200")
i = dr.Item("back_300")
Response.Write(a)
Response.Write("<br>")
Session("z") = Session("z") + a
Session("y") = Session("y") + b
Session("x") = Session("x") + c
Session("w") = Session("w") + d
Session("v") = Session("v") + f
Session("u") = Session("u") + g
Session("t") = Session("t") + h
Session("s") = Session("s") + i
End While