Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLDataSource how to load data to datatable or dataset
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01338496
Message ID:
01338525
Views:
12
>Dear All,
>
>I am using Visual Studio 2008, I created SQLDatasource by draging it into the form and then follow the wizard.
>
>how do I load data into datatable or dataset?
>

You will need to make sure that the DataSourceMode is set to DataSet, ex.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataSet"
From the code-behind you can get at the data using code like this:
using System.Collections;

// Inside of a method...
IEnumerable items = this.SqlDataSource1.Select(DataSourceSelectArguments.Empty);
// To get the DataSet
DataSet ds = items.Table.DataSet;
// To get at a DataTable
DataTable table = items.Table;
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform