SQLDatasource with Basic Repeater

Rehan Baber asked on September 22, 2016 14:26

I have a SQLDatasource connected with Sql Server under a Web part zone and a basic repeater is connected with that SQLDatasource in the same web Part Zone. Can anyone guide me how to write its transformation using ASCX in Kentico9? And why am I seeing the page type and Class type when I click on new transformation? And what they have to do with my transformation?

I basically want to show the result of my Query on my WebPage.

Correct Answer

Brenden Kehren answered on September 22, 2016 14:46

Best and recommended thing to do is create a new page type that acts as a placeholder for your queries and transformations for those objects which are not located within the Kentico database. So when you create a new page type on the second screen (after you enter a name, choose the 2nd option (The page type is only a container without custom fields) and it will create the container for you without any database table and column representation. This will allow you to create custom queries and transformations.

So after you've created your new container page type, create a new transformation as you normally would. In your transformation use the normal syntax Eval("YourColumnName") which will be returned in that dataset from your SQL Datasource webpart. In your Basic Repeater, select the new container page type you created and select the transformation you just created and you'll be set.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Rehan Baber answered on September 23, 2016 06:27

Thankyou Brenden that was really helpful.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.