彩票查询_2021美洲杯决赛:阿根廷vs巴西回放_2025世俱杯参赛球队有哪些_英格兰乙级联赛 - 竞彩足球500

快壓

當前位置:首頁 > 電腦技巧 > 正文

解決一個.NET聯接SQL的問題

瀏覽次數:|更新日期:2015年04月16日

  Imports System.Data
  Imports System.Data.SqlClient
  Imports System.Data.SqlClient.SqlException
  Public Class connect
  Private s As String
  Private s1 As String
  Public Connect As New SqlConnection(“server=Yiyang;database=KDERP;uid=sa;password=123″”)
  Sub New()
  Connect.Open()
  End Sub
  Public Property sql()
  Get
  Return s
  End Get
  Set(ByVal Value)
  s = Value
  End Set
  End Property
  Public Property table()
   Get
   Return s1
   End Get
   Set(ByVal Value)
   s1 = Value
  End Property
  Public Function Retable() As DataTable
  Dim com As New DataSet()
  Dim ada As New SqlDataAdapter()
  Dim com1 As New SqlCommand()
  com1.Connection = Connect
  com1.CommandText = s
  ada.SelectCommand = com1
  ada.Fill(com