Solve a .NET join SQL problem

zhaozj2021-02-16  37

Imports System.DataImports System.Data.SqlClientImports System.Data.SqlClient.SqlExceptionPublic 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 "pUBLIC version 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 recetDataSet (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 functionend Class

转载请注明原文地址:https://www.9cbs.com/read-26166.html

New Post(0)