I need to get the title (report name) from a stored procedure in VB, but I have variable name “title” which need to use that stored procedure in order to get that title. How should I do this?
Also the output of the stored procedure has spaces which I need to remove in VB code.
The variable looks like this:
Dim title as string = 'titlereportname_' & Format(Now(), "M-d-yy")
How should I make that title not to be hard coded but come from the stored procedure?
I got the following connection:
Dim dt As DataTable
Dim conn As New SqlClient.SqlConnection()
Dim command As New SqlClient.SqlCommand
dt = New DataTable
conn = new SqlClient.SqlConnection(DataProvider.connectionstring(sDatabaseAlias))
conn.Open()
command = New SqlClient.SqlCommand
command.CommandType.Text
command.CommandText = "GetReportTitle"
command.Parameters.AddWithValue("@ProjectName", sProject)
command.Parameters.AddWithValue("@Link", sLink)
command.Connection = conn
dt.Load(command.ExecuteReader())
command.Dispose()
conn.Close()
conn.Dispose()