Click here to Skip to main content
15,890,512 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: webservice Pin
Christian Graus5-Sep-09 11:25
protectorChristian Graus5-Sep-09 11:25 
GeneralRe: webservice Pin
farokhian5-Sep-09 11:35
farokhian5-Sep-09 11:35 
GeneralRe: webservice Pin
Christian Graus5-Sep-09 12:06
protectorChristian Graus5-Sep-09 12:06 
GeneralRe: webservice Pin
Abhijit Jana5-Sep-09 11:33
professionalAbhijit Jana5-Sep-09 11:33 
GeneralRe: webservice Pin
Abhishek Sur5-Sep-09 12:03
professionalAbhishek Sur5-Sep-09 12:03 
AnswerRe: webservice Pin
Abhishek Sur5-Sep-09 10:46
professionalAbhishek Sur5-Sep-09 10:46 
Questionhow to select first several datarow from a dataset, and how to create a dataset from datarow? Pin
Seraph_summer5-Sep-09 9:35
Seraph_summer5-Sep-09 9:35 
AnswerRe: how to select first several datarow from a dataset, and how to create a dataset from datarow? Pin
Abhishek Sur5-Sep-09 10:16
professionalAbhishek Sur5-Sep-09 10:16 
First of all, let me clear your concept about DataSet, DataTable and DataRow.

1. DataSet ( It is a collection of DataTables)
2. DataTable (It is a collection of DataRow)
3. DataRow (It is a collection of Data Elements)

Well, Now if you have a datatable, you cant create a DataSet from it... as basically it is already a part of a dataset. If you are talking about coping some rows from one DataTable to a new DataTable, this can be done. Just I am going to create an example for you below :

DataTable dtNew = dt.Clone();
var dataSelect = (from r in dt.AsEnumerable()
                  orderby r[0]
                  select r).Take(5);
foreach (DataRow dr in dataSelect)
{
     DataRow newRow = dtNew.NewRow();
     for(int i=0; i<dr.Table.Columns.Count; i++)
        newRow[dr.Table.Columns[i] = dr.Table.Columns[i];
}


After the foreach loop the DAtaTable dtNew will hold only the 5 elements selected in dataSelect.
Hope you got the point. Just mold this into your requirement.

Cheers Cool | :cool:

Abhishek Sur

My Latest Articles
Create CLR objects in SQL Server 2005
C# Uncommon Keywords
Read/Write Excel using OleDB

Don't forget to click "Good Answer" if you like to.

GeneralRe: how to select first several datarow from a dataset, and how to create a dataset from datarow? Pin
Seraph_summer5-Sep-09 11:16
Seraph_summer5-Sep-09 11:16 
GeneralRe: how to select first several datarow from a dataset, and how to create a dataset from datarow? Pin
Abhishek Sur5-Sep-09 12:07
professionalAbhishek Sur5-Sep-09 12:07 
Questiondownloadable files Pin
hasani20075-Sep-09 7:35
hasani20075-Sep-09 7:35 
AnswerRe: downloadable files Pin
Manas Bhardwaj5-Sep-09 7:40
professionalManas Bhardwaj5-Sep-09 7:40 
AnswerRe: downloadable files Pin
Abhishek Sur5-Sep-09 7:54
professionalAbhishek Sur5-Sep-09 7:54 
QuestionUser control with ListView and event wiring. Pin
CodeProjectNeil5-Sep-09 5:51
CodeProjectNeil5-Sep-09 5:51 
AnswerRe: User control with ListView and event wiring. Pin
Abhishek Sur5-Sep-09 10:30
professionalAbhishek Sur5-Sep-09 10:30 
QuestionTreeView - Load/Save XMLDataSource Pin
krishy195-Sep-09 4:59
krishy195-Sep-09 4:59 
AnswerRe: TreeView - Load/Save XMLDataSource Pin
Arindam Sinha5-Sep-09 5:44
Arindam Sinha5-Sep-09 5:44 
QuestionHave the HTML output Pin
behnam-s5-Sep-09 4:12
behnam-s5-Sep-09 4:12 
AnswerRe: Have the HTML output Pin
Manas Bhardwaj5-Sep-09 6:36
professionalManas Bhardwaj5-Sep-09 6:36 
AnswerRe: Have the HTML output Pin
Abhishek Sur5-Sep-09 8:19
professionalAbhishek Sur5-Sep-09 8:19 
GeneralRe: Have the HTML output Pin
behnam-s6-Sep-09 4:38
behnam-s6-Sep-09 4:38 
GeneralRe: Have the HTML output Pin
Abhishek Sur6-Sep-09 22:29
professionalAbhishek Sur6-Sep-09 22:29 
QuestionA Query Pin
mehrdadc485-Sep-09 2:59
mehrdadc485-Sep-09 2:59 
AnswerRe: A Query Pin
Abhijit Jana5-Sep-09 3:01
professionalAbhijit Jana5-Sep-09 3:01 
GeneralRe: A Query Pin
mehrdadc485-Sep-09 3:28
mehrdadc485-Sep-09 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.