No Description
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.

SQL_Module.vb 1.7KB

123456789101112131415161718192021222324252627282930313233343536
  1. Imports System.Data.SqlClient
  2. Imports System.IO
  3. Module SQL_Module
  4. Public ConString, SQL1, SQL2, 進度條後墜, PA As String
  5. Public conn As New SqlConnection : Public cmd As New SqlCommand
  6. Public dr As SqlDataReader : Public da As New SqlDataAdapter
  7. Public 分段1, 分段2, 分段3, 分段4 As Double
  8. Public 分母, 圖庫限制 As Integer
  9. Friend Sub ConnOpen()
  10. conn.Close() : If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  11. End Sub
  12. Friend Sub CmdSet_For_DGV()
  13. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd
  14. End Sub
  15. Friend Sub CmdSet_For_dr()
  16. cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
  17. End Sub
  18. Friend Sub SQL_連線字串_資料庫()
  19. ConString = "Data Source=" & GCM_SQL_MGMT.IP_tb.Text & ";
  20. Initial Catalog=" & GCM_SQL_MGMT.資料庫_tb.Text & ";
  21. Persist Security Info=True;
  22. User ID=" & GCM_SQL_MGMT.帳號_tb.Text & ";
  23. Password=" & GCM_SQL_MGMT.密碼_tb.Text & ";
  24. Max pool size = 200;
  25. Connection Timeout=0"
  26. End Sub
  27. Friend Sub SQL_連線字串_圖片資料庫()
  28. ConString = "Data Source=" & GCM_SQL_MGMT.IP_tb.Text & ";
  29. Initial Catalog=" & GCM_SQL_MGMT.選擇_tb.Text & ";
  30. Persist Security Info=True;
  31. User ID=" & GCM_SQL_MGMT.帳號_tb.Text & ";
  32. Password=" & GCM_SQL_MGMT.密碼_tb.Text & ";
  33. Max pool size = 200;
  34. Connection Timeout=0"
  35. End Sub
  36. End Module