Option Explicit On
Option Strict On
Imports System.Data
Imports System.Data.OleDb
Imports System.Drawing.Printing
Imports System.Windows.Forms
Public Class Admin_Conf_Dialog1
Inherits System.Windows.Forms.Form
Dim Conn As OleDbConnection = New OleDbConnection()
Dim da As OleDbDataAdapter
Dim ds As DataSet = New DataSet()
Dim UseFont As New Font("MS Sans Serif", 10)
Dim prDoc As PrintDocument = New PrintDocument
Private prDlg As PrintDialog = New PrintDialog
Dim IsFind As Boolean = False
Dim ToClose As Boolean = False
Private Sub Admin_Conf_Dialog1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
With Conn
If .State = ConnectionState.Open Then .Close()
.ConnectionString = con
.Open()
End With
txt_oder_id.Text = C_ResId
txt_camp.Text = C_ResCamp
txt_company.Text = C_ResCompany
txt_product.Text = C_Resproduct
txt_ch.Text = C_Reschannel
txt_posi.Text = C_Resposition
txt_imp_oder.Text = CStr(C_ResImpresstion)
txt_start_date.Text = C_Resstartdate
txt_end_date.Text = C_Resenddate
txt_sale_name.Text = C_ResBy
txt_dayrec.Text = C_Resdate
Dim sqllist As String = ""
Dim DateStart As Date
Dim DateEnd As Date
DateStart = CDate(C_Resstartdate)
DateEnd = CDate(C_Resenddate)
sqllist = "SELECT ch_day,P_name,ch_name,ch_posi,imp_now "
sqllist &= "FROM Impress"
sqllist &= "WHERE (ch_day BETWEEN #" & DateStart & "# "
sqllist &= "And #" & DateEnd & "#)"
sqllist &= "And (P_name=" & C_Resproduct & ")And(ch_name=" & C_Reschannel & ")And(ch_posi=" & C_Resposition & ")"
sqllist &= "ODER BY ch_day;"
da = New OleDbDataAdapter(sqllist, Conn)
da.Fill(ds, "Impress")
DataGridView1.DataSource = ds.DefaultViewManager
With Conn
If .State = ConnectionState.Open Then .Close()
.ConnectionString = con
.Open()
End With
End Sub
End Class