- Get link
- X
- Other Apps
Public Function RetornaReport(ByVal sSQL As String, Optional ByVal sSortBy As String = "", Optional ByVal sSortDirection As String = "") As DataSet
End Function
Dim str As New StringBuilder
Dim strResultado As New StringBuilder
Dim cmd As New SqlCommand
Dim conn As New SqlConnection
conn.ConnectionString=ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString
cmd.Connection = conn
str.Append(sSQL)
cmd.CommandText = str.ToString
cmd.CommandType = CommandType.Text
conn.Open()
Dim Adapter As New SqlDataAdapter(cmd)
Dim ds As New DataSet
Adapter.Fill(ds)
conn.Close()
conn.Dispose()
Adapter.Dispose()
cmd.Dispose()
Return ds
End Function
Comments