12345678910111213141516171819202122232425262728293031323334353637 |
- Imports System.Data.SqlClient
- Imports System.Reflection
- Public Class Frm_Chem_use
- Dim cmd As New SqlCommand
- Dim da As New SqlDataAdapter
- Dim dt As New DataTable
- Dim sql As String
- Dim conn As New SqlConnection
- Dim DR As SqlDataReader
- Private Sub Frm_Chem_use_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.MdiParent = FrmMDI
-
- Dim type As Type = dgv_period.GetType()
- Dim pi As PropertyInfo = type.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
- pi.SetValue(dgv_period, True, Nothing)
-
-
-
- conn.ConnectionString = connstring
- conn.Open()
-
-
- cmd.Connection = conn
-
-
- sql = "SELECT year(date),month(date) from rt_sys_chem_out group by year(date),month(date) order by year(date) desc,month(date) desc"
- cmd.CommandText = sql
- da.SelectCommand = cmd
- da.Fill(dt)
- dgv_period.DataSource = dt
-
-
-
-
-
- End Sub
- End Class
|