1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | Public Function MyDataSet(ByVal strSQL As String) As DataSet Dim ds As New DataSet Dim mycmd As MySqlCommand = New MySqlCommand(strSQL, objConn) Dim ad As MySqlDataAdapter = New MySqlDataAdapter ad.SelectCommand = mycmd objConn.Open() ad.Fill(ds, "a") objConn.Close() Return ds End Function
Public Function MsDataset(ByVal strSQL As String, ByVal strConn As String) As DataSet Dim ds As New DataSet Dim newStrConn As New SqlConnection(strConn) Dim sqlcmd As SqlCommand = New SqlCommand(strSQL, newStrConn) Dim ad As SqlDataAdapter = New SqlDataAdapter ad.SelectCommand = sqlcmd newStrConn.Open() ad.Fill(ds, "a") newStrConn.Close() Return ds End Function
|
No comments:
Post a Comment