Click here to Skip to main content
15,890,946 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Funny FileNotFoundException Pin
Sonhospa11-Oct-11 5:32
Sonhospa11-Oct-11 5:32 
QuestionFTP with multiple folders for each FTP user Pin
QuickBooksDev10-Oct-11 10:18
QuickBooksDev10-Oct-11 10:18 
QuestionProblem with inser data from vb2008 to Ms Acesss DB Pin
Mangore759-Oct-11 12:06
Mangore759-Oct-11 12:06 
AnswerRe: Problem with inser data from vb2008 to Ms Acesss DB Pin
Armigo10-Oct-11 3:09
Armigo10-Oct-11 3:09 
Questionimport from excel Pin
alejx4-Oct-11 7:48
alejx4-Oct-11 7:48 
GeneralRe: import from excel Pin
Paladin20004-Oct-11 8:07
Paladin20004-Oct-11 8:07 
AnswerRe: import from excel Pin
Dalek Dave6-Oct-11 22:31
professionalDalek Dave6-Oct-11 22:31 
Question[solved] sorting a subset of a datatable in a different order Pin
Armigo4-Oct-11 2:16
Armigo4-Oct-11 2:16 
Hello everybody,

i want to sort a specific part of my datatable in a different order. this is how i try to achive my goal:

1. Determine begin- and end-indices of the subset of the datatable
2. Import Rows into a new, temporary datatable
3. Assign new datatable to a dataview via the method DefaultView
4. Sort dataview
5. Reassign data from dataview to temporary datatable with method ToTable
6. copy datarows of temporary datatable to the origin datatable, beginning at the determined indices

I have two questions concerning my algorithm:

1. Is there an easier way to solve my problem?
2. step four doesn't work, because the columns of the origin datatable are not recognized in the new datatable. The question is: How can i import rows of an existing datatable to a new datable?

thanks in advance
Armigo


Code for step 2-4:
VB
For i = iBegin To iEnd
    tempTable.ImportRow(dataset.Tables("xy").Rows(i))
Next

dataview = tempTable.DefaultView
dataview.Sort = "a, b"


modified 10-Oct-11 7:55am.

AnswerRe: sorting a subset of a datatable in a different order Pin
Dave Kreskowiak4-Oct-11 3:30
mveDave Kreskowiak4-Oct-11 3:30 
QuestionRe: sorting a subset of a datatable in a different order Pin
Armigo4-Oct-11 22:52
Armigo4-Oct-11 22:52 
AnswerRe: sorting a subset of a datatable in a different order Pin
Simon_Whale4-Oct-11 23:36
Simon_Whale4-Oct-11 23:36 
AnswerRe: sorting a subset of a datatable in a different order Pin
Dave Kreskowiak5-Oct-11 4:46
mveDave Kreskowiak5-Oct-11 4:46 
GeneralRe: sorting a subset of a datatable in a different order Pin
Armigo10-Oct-11 2:30
Armigo10-Oct-11 2:30 
AnswerRe: sorting a subset of a datatable in a different order Pin
Luc Pattyn4-Oct-11 4:08
sitebuilderLuc Pattyn4-Oct-11 4:08 
Questionadding a reference System.Web.UI Pin
Minenhle Ndlovu3-Oct-11 3:20
Minenhle Ndlovu3-Oct-11 3:20 
AnswerRe: adding a reference System.Web.UI Pin
Dave Kreskowiak3-Oct-11 3:39
mveDave Kreskowiak3-Oct-11 3:39 
AnswerRe: adding a reference System.Web.UI Pin
Luc Pattyn3-Oct-11 4:27
sitebuilderLuc Pattyn3-Oct-11 4:27 
AnswerRe: adding a reference System.Web.UI Pin
Simon_Whale3-Oct-11 4:46
Simon_Whale3-Oct-11 4:46 
AnswerRe: adding a reference System.Web.UI Pin
Eddy Vluggen3-Oct-11 8:30
professionalEddy Vluggen3-Oct-11 8:30 
QuestionHow to print multiple reportviewer report on a single button? Pin
C#Coudou2-Oct-11 13:46
C#Coudou2-Oct-11 13:46 
QuestionHow to create my own spammer with VBscript Pin
Shubhamraj1-Oct-11 20:01
Shubhamraj1-Oct-11 20:01 
AnswerRe: How to create my own spammer with VBscript Pin
Richard MacCutchan1-Oct-11 21:29
mveRichard MacCutchan1-Oct-11 21:29 
AnswerRe: How to create my own spammer with VBscript PinPopular
Dalek Dave1-Oct-11 22:44
professionalDalek Dave1-Oct-11 22:44 
GeneralRe: How to create my own spammer with VBscript Pin
Sander Rossel2-Oct-11 0:16
professionalSander Rossel2-Oct-11 0:16 
GeneralRe: How to create my own spammer with VBscript Pin
Richard MacCutchan2-Oct-11 1:49
mveRichard MacCutchan2-Oct-11 1:49 

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.