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, "T1")
return COM. Tables (0)
End Function
Public Function Exec () as Integer
Dim I as Integer
Dim com as New SqlCommand ()
Com.commandtext = S
Com. Connection = Connect
i = com. ExecuteNonQuery ()
return I
End Function
Public Function Retdataset (ByVal t as String) as DataSet
Dim com as New SqlCommand ()
Com. Connection = Connect
Com.commandtext = S
Dim Ada as New SqlDataAdapter ()
Ada. SelectCommand = com
Dim da as New DataSet ()
Ada. Fill (DA, T)
Return da
End Function
Public Function Retdataread () as SqlDataReader
Dim com as New SqlCommand ()
Com. Connection = Connect
Com.commandtext = S
return COM. ExecuteReader
End Function
End Class
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service