C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Extracting Datatable From SqlDataSorce


Posted Date: 15 May 2008    Resource Type: Code Snippets    Category: ADO.NET
Author: jayapragash.DMember Level: Gold    
Rating: Points: 10



SqlDatasource is a control that gives us options to binding the data to DataGrid, Gridview but now

Give the data that data view gives as a data table, which will be really useful in many situations.

Converting to Datatable

DataSourceSelectArguments arg = new DataSourceSelectArguments();
DataView dv = new DataView();
dv = (DataView)SqlDataSourceDataGrid.Select(arg);
if (dv != null)
DataTable dt_new = dv.ToTable();
GRIDVIEW.DataSource = dt_new;
GRIDVIEW.DataBind();

Regards
D.jayapragash




Responses

Author: Bharathi    21 May 2008Member Level: Diamond   Points : 2
Can you please clear me the use of "DataSourceSelectArguments"
in this context.

Thanks in advance.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: DB Null validation in the data Reader.
Previous Resource: How to get record from 5 to 15 from a dataset
Return to Discussion Resource Index
Post New Resource
Category: ADO.NET


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use