I have had several occations where I needed to retreive simple information from the SQL database using SQL. I do not find any API that returns the database connection string or allows execution of SQL query.
Now, I know this is "Dangerous", but it is also very powerful.
I have functions in my API that do this, but they are very restricted to a known connection string.
Public Function GetNextRevision(ThisFile As IEdmFile5)
Dim strFileName As String = ThisFile.Name
Dim da As New SqlClient.SqlDataAdapter
Dim cn As New SqlClient.SqlConnection
cn.ConnectionString = strConnectionString
If cn.State = 0 Then
Dim strSQL As String = "Select * from documents where ..."
Dim cmdSQL As New SqlClient.SqlCommand
cmdSQL.CommandText = strSQL
Dim ds As New System.Data.DataSet
cmdSQL.Connection = cn
da.SelectCommand = cmdSQL
If ds.Tables("Documents").Rows.Count > 0 Then
Any thoughts on this?