This is a migrated thread and some comments may be shown as answers.

Drill down functionality stored procedure

2 Answers 28 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 14 Jul 2014, 11:09 AM
Dear Telerik,

I'm following your demo on 
http://blogs.telerik.com/aspnet-ajax/posts/13-05-07/how-to-implement-drill-down-functionality-in-telerik-s-pivotgrid-for-asp.net-ajax-part-1

My question is how can I modify my code to use stored procedure with parameter selection if I have a sqldatasource in the aspx page in front?

Thanks for the assist.

Best regards.

2 Answers, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 14 Jul 2014, 01:06 PM
Hi All,

I figured to syntax which will be 

 [quote] public DataTable GetDataTable(string PivotFilter)
        {
            String ConnString = ConfigurationManager.ConnectionStrings["Telerik"].ConnectionString;
            SqlConnection conn = new SqlConnection(ConnString);
            SqlDataAdapter adapter = new SqlDataAdapter();
            adapter.SelectCommand = new SqlCommand("SP_Telerik", conn);
            adapter.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;

            DataTable myDataTable = new DataTable();
            conn.Open();
            try
            {                
                adapter.Fill(myDataTable);
            }
            finally
            {
                conn.Close();
            }
            
            return myDataTable;
        }[/quote]

However, my new problem is the myDataTable is always null, any thought?


Cheers.
0
Konstantin Dikov
Telerik team
answered on 17 Jul 2014, 07:23 AM
Hello Tim,

Thank you for contacting Telerik Support.

I am glad to see that you were able to fix the initial issue.

As for your new problem, since the data retrieval is not related to our controls in any way, the only thing that we can suggest is that you take a look at the following help articles and ensure that your stored procedure is correctly set:
Hope this helps.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PivotGrid
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or