1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Create a data source

Create a data source

8 posts, 0 answered
  1. Darshani
    Darshani avatar
    18 posts
    Registered:
    13 Oct 2009
    22 Oct 2009
    Link to this post
    Hi,

    I am having a scenario where I need to get a grid displayed on a page populated with specific data (say all event related data) from the database. I added a GridView from Data control and when trying edit, it asked for a DataSourceID. That implies I should be able to create a DataSource in the CMS. Does anyone has an idea where I can create that?

    Need a quick response!

    Thanks,
    Darshani
    www.eyepax.com
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Oct 2009
    Link to this post
    Hello Darshani,

    You can register SqlDataSource server control in your web.config file

    <add name="SqlDataSourceControl" section="Data" type="System.Web.UI.WebControls.SqlDataSource, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    Then you should configure SqlDataSource control and drop it in the same naming container in which have have GridView.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Darshani
    Darshani avatar
    18 posts
    Registered:
    13 Oct 2009
    22 Oct 2009
    Link to this post
    Hi Ivan,

    Thanks for the rapid response.

    Under which tag should I create the SqlDataSource server control? Is it between <toolboxControls></toolboxControls>?

    Regards,
    Darshani
    www.eyepax.com
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Oct 2009
    Link to this post
    Hi Darshani,

    You need to register the control between <toolboxControls> opening and closing tag in your web.config file.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Darshani
    Darshani avatar
    18 posts
    Registered:
    13 Oct 2009
    22 Oct 2009
    Link to this post
    Thanks Ivan,

    I added the control successfully. However when specifying the select command is it generic SQL commands that I should input?

    Regards,
    Darshani
    www.eyepax.com
  6. Darshani
    Darshani avatar
    18 posts
    Registered:
    13 Oct 2009
    22 Oct 2009
    Link to this post
    Hi,

    Can someone give me any guidance about defining any (insert/update/select) command in SqlDataSouce Control? I wrote

    Select Command = "select * from sf_Events" and created a error message saying

    Server Error in '/' Application.

    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Thanks,
    Darshani
    www.eyepax.com
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    22 Oct 2009
    Link to this post
    Hi Darshani,

    Disable the custom errors, the message you have pasted does not have any useful information.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Darshani
    Darshani avatar
    18 posts
    Registered:
    13 Oct 2009
    22 Oct 2009
    Link to this post
    Hi Ivan,

    But there is no data populated on the Grid so there should be something wrong with the select command. Is that command right?

    Darshani
    www.eyepax.com
Register for webinar
8 posts, 0 answered