Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

SSRS 2005 Custom Code shared data source connection string

$
0
0

i have custom code that queries a table and retuns a value.  code below which is working.

My question: is it possible to reference the shared Data Source somehow as my query accesses the same data base as the report?

 

Public Function GetReportingWindow() As String

 Dim strConnection as String = "Data Source=x.x.x.x;Initial Catalog=ip360Dashboard;User Id=********;Password=******;"
 
  Dim window as String
 
 Using conn As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(strConnection)

   Dim cmd As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand("SELECT numberOfReportingDays from [$_sivms_config] where id=1", conn)
   
   conn.Open()
   
   Dim dr As System.Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
   
   If dr.HasRows Then
    While dr.Read()
      window =  dr(0).ToString()
   End While
   
  Else
     window = "??"
   End If
   
   dr.Close()
   conn.Close() 
   
  End Using
  return window
 
End Function


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>