Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Trying to bind results from stored procedure to Line chart
posted

I am calling a stored procedure where I pass variable for number of days to report on. 

            With cmd
                .Connection = sqlcon
                .CommandType = CommandType.StoredProcedure
                .Parameters.Clear()
                .CommandText = "dbo.GetAverageResolvedTimeforDashBoard"
                .Parameters.AddWithValue("@Days", dy)
                .Parameters.Add("@Recs", SqlDbType.Int).Value = DBNull.Value
                .Parameters("@Recs").Direction = ParameterDirection.Output
            End With
I then define a DataTable and fill it using a DataAdapter.
 Dim datTab As New DataTable
         Try
                Using myadp As SqlDataAdapter = New SqlDataAdapter(cmd)
                    myadp.Fill(datTab)
                End Using
                ugResolved.Data.SwapRowsAndColumns = True
                ugResolved.DataSource = datTab
                ugResolved.DataBind()

            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
When I run the Stroed Procedure in Management Studios I get the results I expect
When I run from IDE in Visual Studio 2017, code is Vb, I get a white box saying Data Not Available. Please call UltraChart.Data>dateBind() after setting valid Data.DataSource.
I have put break point in and printed out all the values for DataTable (DatTab) and all the data is there. My question is why won't it Bind  What am I missing.
Parents Reply Children
No Data