Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Frm_Chem_use.vb 1011B

12345678910111213141516171819202122232425262728293031323334353637
  1. Imports System.Data.SqlClient
  2. Imports System.Reflection
  3. Public Class Frm_Chem_use
  4. Dim cmd As New SqlCommand
  5. Dim da As New SqlDataAdapter
  6. Dim dt As New DataTable
  7. Dim sql As String
  8. Dim conn As New SqlConnection
  9. Dim DR As SqlDataReader
  10. Private Sub Frm_Chem_use_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  11. Me.MdiParent = FrmMDI
  12. Dim type As Type = dgv_period.GetType()
  13. Dim pi As PropertyInfo = type.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
  14. pi.SetValue(dgv_period, True, Nothing)
  15. conn.ConnectionString = connstring
  16. conn.Open()
  17. cmd.Connection = conn
  18. 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"
  19. cmd.CommandText = sql
  20. da.SelectCommand = cmd
  21. da.Fill(dt)
  22. dgv_period.DataSource = dt
  23. End Sub
  24. End Class