Changing DataColumn DataType in the same DataTable

hi,
I have following requirement.
In a DataTable, I have a DataColumn with String as DataType (This has dateTime data in String format). I want to change this DataType to DateTimeStamp and then sort it in ASC order.
Could someone please share sample code to do this?
Appreciate for your help.
Many Thanks,
Alex
AC

Hi Alex,
>> In a DataTable, I have a DataColumn with String as DataType (This has dateTime data in String format). I want to change this DataType to DateTimeStamp and then sort it in ASC order. Could someone please share sample code to do this?
As far as I know, the DateTimeStamp is an element in Exchange Server, there is “System.DateTime” in C#. Do you want to covert the string to System.DateTime, and sort it in ASC order? If so, I will recommend you add a new column, convert the string to DateTime,
add the value of the DateTime to the new column, and then sort by the new column.
For information about adding new column, you could refer the link below:
# DataTable Class
https://msdn.microsoft.com/en-us/library/system.data.datatable(v=vs.110).aspx
For information about converting the string to DateTime, you could refer the link below:
# How to: Convert a String to a DateTime (C# Programming Guide)
https://msdn.microsoft.com/en-us/library/cc165448.aspx?f=255&MSPPError=-2147217396
For information about sorting by the new column, you could refer the link below:
# Dataset sorting in c#
https://social.msdn.microsoft.com/Forums/vstudio/en-US/adbd95cd-49d1-483d-b2b2-4b696a66e9a6/dataset-sorting-in-c?forum=netfxbcl
If I misunderstand you, please feel free to let me know.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.

Similar Messages

  • My Apple ID and rescue email are reversed. How can I change them both at the same time

    My Apple ID and rescue email are reversed. How can I change them both at the same time?

    I'd already used this standard tool (exhaustively!), but for the problem encountered it operated in Catch 22 mode - you had to do two things but neither order was permitted. I did find an answer eventually, but am not sure what it was I did that solved it! Thanks, anyway.

  • I receive a message indicating that my Apple ID is disabled . Although I've changed my password still the same problem exists.

    I receive a message indicating that my Apple ID is disabled . Although I've changed my password still the same problem exists.

    Mehrak88 wrote:
    I receive a message indicating that my Apple ID is disabled . Although I've changed my password still the same problem exists.
    Mehrak,
    Messages like that are almost always phishing, and are not actually from Apple.  Changing password does not affect it, since they can still send you the same email.
    See this document:
    Identifying fraudulent "phishing" email
    Does it fit the description, or is it something else?

  • I have 2 Apple ID's with separate e-mails.  I want to change my iTunes to the same e-mail as my iPhone.  Any suggestions?

    I have 2 Apple ID's, one attached to my iTunes account, and one attached to my iPhone.  I want to change both to the same e-mail/Apple ID. any ideas on how I can do this without losing any info (contacts, songs, videos, etc.)?

    Why would you create a new account?
    All purchases will be tied to the account from which they were purchased.
    You will have to authorize your computer for all the accounts from which music is purchased.

  • Itunes 10 imports cd tracks in alphabetical order only.  What setting do I change so it imports the same order as the cd?

    itunes 10 imports cd tracks in alphabetical order only.  What setting can I change so that it will import cd tracks in the same order as on the cd?  Any help would be appreciated!  I have this issue on only 1 of my 2 macbook pro computers, so I'm guessing it is a setting issue--but I don't know where to find it.

    The apparent order of a burned CD may depend upon how you have iTunes display it - https://discussions.apple.com/message/17827921

  • Weird: changing file or link associated defaults then changes ALL defaults to the same program

    Y'know... I thought I'd possibly 'seen it all' but today someone brought me a laptop with something I don't believe I've ever seen...
    every link and file association is defaulted to the wrong program, and it is not possible to restore the association to the proper program for the respective file types.  And changing one
    association changes ALL other associations for every other link to a file or shortcut.
    For instance: 'right-clicking' on what I KNOW to be an Adobe Acrobat file and selecting 'open with...' from the context menu, Adobe Acrobat is not shown (even after un-installing and re-installing Acrobat).  So I 'browse' to the Program files (x86)
    folder and select Adobe Acrobat (AcroRd32.exe) from within the Adobe Acrobat program folder to 're-associate' .pdf files with Acrobat..  BUT - this then changes ALL associations for everything  (including shortcuts on the desktop) to Adobe Acrobat.
      And the same can be said if I attempt to change the file association for a "docx" file extension (MS Word document).  Change the 'association' for one single 'docx' file and this results in ALL files or shortcuts on the desktop to also
    change to MS Word.
    So - what the ...?  Anyone have a clue as to what he's done on this "brand new" installation of Windows Home Premium (64-bit)?  I only just (this past week) talked him into 'abandoning' XP in favor of a license of Windows 7 Home Premium,
    and afterwards everything was 100% and fully operational - but now one week later and he's done this...
    So...  A registry issue..? Something to do with 'file association' defaults? (and my suspicion is some sort of 'dll' problem with this performance and the issue of not being able to configure 'program defaults' for any given file type without also affecting
    all other associations...).
    So,short of backing up all his data (out of precaution) and trying to do a 're-installation' of Windows, my most immediate response with this would be to just 'blow it away' and re-install Windows again ... and then copy all of his data back to the corresponding
    locations.  But I would like to know what he's possibly done (for future reference) and maybe learn of some possibility that this can be 'fixed' and the correct 'associations' re-established without having to re-install Windows one more time...
    GAA! THIS is why I shave my head...

    Hi,
    According to the description, it seems that the issue is caused by some corrupted registry entry\keys, a corrupted registry key can be caused by an malware\virus, or an bad-coded program or just some incorrect operation by the user. it's hard to determin
    which is the culprit, but we can try to repair it as we could.
    Please refer to the following link and see if it helps, (backup your registry first before editing the registry)
    http://support.microsoft.com/kb/950505
    we can also create a new user profile instead and copy files and setting from the old profile
    http://windows.microsoft.com/en-in/windows/fix-corrupted-user-profile#1TC=windows-7
    Yolanda Zhu
    TechNet Community Support

  • Adobe Elements catalog backup fails after 3 discs.  Message says something wrong with dvd writer.  I bought an external dvd burner and changed disc brands, still the same results.

    Full backup of catalog stops after three discs.  I have changed disc brand and added a new external dvd burner but still get the same results.  What is wrong?

    If you have the hard drive space, see if you can complete a back up to the hard drive instead. If that works successfully, it could be a buffer or caching issue with the burner. It could be running out of space because it is not clearing after each disk burn.

  • Change all strokes to the same length?

    Hi all,
    I'm hoping someone can help me with this seemingly simple question. Is there an easy way to change all the strokes in the document to the same length? Thanks!
    Cheers,
    Trish
    InDesign CS4 | PC

    Stix Hart wrote:
    You can't even select a whole lot of strokes of differen lengths and make them the same.  Unless (hopefully) I'm missing something?
    Wow, I would have thought the Transform Again option would work for that.   I just tested and it doesn't appear to work on strokes though.  Weird....

  • Spell Check and changing multiple instances of the same word

    Hi, sorry if this has been brought up before.. I can't seem to find any reference, so here's my dilemma:
    My main writing language in Pages is Spanish and when it comes time for me to run the spell check, I usually have to change the same word a lot, because of missing accents and such. (I'd rather concentrate on writing and not worry about whether it has the right accent). Does Pages have any way to automatically detect when a word has been corrected, and pass the correction to any other instance of that word? I have tried using Find and Replace, but its not perfect, changing perfectly spelled words to include any corrections because the words, I think, appear similar. Is there a trick within Pages to do this? Does anyone know if the new version of Pages includes such a feature? Apple's iWork website and presentations fail to mention it...
    Any suggestions will be appreciated.

    I got it working, thanks es5f2000. I sat and thought about it and worked it out. (Pretty simple) Heres the code:
    public void findWord()
             x = iTab.getEditorList(iTab.getIndex());
             try
               int index = x.getDocument().getText(0, x.getDocument().getLength()).toLowerCase().indexOf(tFindText.getText().toLowerCase());
               int index2 = x.getDocument().getText(0, x.getDocument().getLength()).toLowerCase().indexOf(tFindText.getText().toLowerCase(), x.getCaretPosition());
               if (index >= 0)
                 System.out.println("found:)" + index);
                 x.requestFocus();
                 x.select(index, index + tFindText.getText().length());
                 if(x.getCaretPosition() > 0)
                   System.out.println("found:)" + index2);
                   x.requestFocus();
                   x.select(index2, index2 + tFindText.getText().length());
               else
                 System.out.println("Not found:(");
             catch(BadLocationException ie) {}
          }

  • Elements 11 change position & scale at the same time

    I have Premiere Elements 11. Can I change position and scale of the same clip over time using keyframes? I have figured out how to zoom in and out and how to pan using keyframes, but when I try to do both, the the first effect applied gets reset.

    ShaneRoney
    Are you in Applied Effects Tab/Applied Effects Palette/Motion Panel expanded and the Position and Scale properties there? Or are you trying to do keyframing at the Timeline clip's rubberband level?
    Assuming the Motion Panel expanded route....
    After you hit Toggle Animation with your Timeline Indicator at the start of your segment with Position and Scale at the start values, move the Timeline Indicator right to the next spot, set the Position fields to where you want them, move the Scale to where you want it, and then move the Timeline Indicator right to the next spot as you move across the clip in this routine.
    At a fixed Timeline Indicator position do both sets before moving the Timeline Indicator to the next spot.
    Assure yourself that you can keyframe Position property by itself and Scale property by itself. Then start again and do both at the same time as suggested above.
    If there are still glitches in the process, please describe further, and we will work out the details where we are differing.
    Thanks.
    ATR

  • How to change apple id using the same email address

    I've had the same apple id for many years, lets just say billybob.  With that it's associated with my email address say [email protected]  When I upgraded to IoS 5 and tried to use iCloud, it says that my appleid must be in the form of an email address.  So I went in to the apple id website to change my apple id to [email protected] and it says I can't because it's already associated with another account (my own).  Is there any way around this?  I'd prefer not to have to create some phantom email address that is only applicable to iCloud.

    Please follow the commands in http://support.apple.com/kb/HE40. I would recommend logging out of your AppleID on all devices then make the change on one device and then re-login on all the other devices.

  • TS1589 my airport stopped working when i changed its location within the same network (wired)

    Please help....I replaced my airport express with an apple tv and moved the airport to a different location within the same wired network and the light continues to flash amber. I know the ethernet connection is good and I have tried restarting the modem/router/airport with no change in status and when I look in the airport utility software, it reports that it cant see it. When I move back to its original location, the light goes green.  What happened and how can i correct this issue? Thanks very much for any assistance.

    the weird thing is that all Ive done is move its pysical location....my house has ethernet ports in every room all running through a common upstream router which in turn is connected to a dsl modem. At this point Ive hard reset the AX back to factory settings....now the AX utility sees the AX but shows me that it has a total of 3 problems. 1) Internet connection...2) no DNS servers...3) default settings. When I highlight "default settings" the info reads "this AX base station has default settings. You should configure it to connect to the internet, secure the wireless network, and provide a password. I assume that if I correct this, the other 2 troubles should take care of themselves.  At the bottom of the page there are buttons that say...help, revert, update and a drop down menu that says default settings, recovered settings, create profile, edit profiles. not sure where to go from here. thaks for taking the time to help me.

  • I changed all songs to the same artist by mistake ...help!

    I accidently changed all my 712 songs to have the same artist. Is there a way to fix them back without manually typing in each artist?
    My son says i can use idump to put the songs from my ipod (which are correct) into a file, then load them into itunes.
    Thanks.
    Mike

    My son says i can use idump to put the songs from my ipod (which are correct) into a file, then load them into itunes
    Yes.
    Were these songs RIP'd from CD using iTunes?
    If so, select them, then menu Advanced -> Get CD track names.

  • Sharepoint Workflow to change another item in the same library

    Is it possible to change another item in the current library using a sharepoint workflow
    I currently has a customised approval workflow that approves procedures. I would like this workflow to set the status of the previous version to archive when the current procedure is approved.
    Jack

    Hi Jack,
    If the documents in your library are all word files and the names of the documents are named as"A001_Rev_+number", you take follow the steps below to update the status column.
    Create a 2013 workflow associated with the library, and start the workflow when an item is created.
    Select Start a task process.
    Select If any value equals value and set it to be: If Variable: Outcome equals Approved.
    Select Extract Substring of String from Index with Length, and set it to be:Copy from Current Item:Name, starting at 0 for 9 characters(Output to Variable: substring).
    Select Set Workflow Variable and set it to be:Set Variable: string to Current Item:Name.
    Select Replace Substring in String and set it to be:Replace Variable: substring with (space) in Variable: string(Output to Variable: output).
    Select Do Calculation and set it to be:Calculate Variable: output to minus 1(Output to Variable: calc).
    Select Update List Item to update the status column(refer to the picture below).
    Select Go to a stage and set it to be:Go to End of Workflow.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Can you change rollover text in the same slice for different triggers?

    Hi, I haven't used Fireworks since version 3, which was about 6 years ago, when I dabbled in web development.  My past has come back to haunt me, and I need to make a fairly simple website pretty quickly for my boss.  I've got myself CS4, and now that I've figured out that you can't use buttons for disjoint rollovers, I'm starting to make progress...
    What I want to achieve, is that there are 6 'buttons' on my page, which when you rollover them will display text in a box to the side.  I would use separate boxes for each button, but there isn't enough space on the page, as there is quite a lot of text, so I would like to use a box in the same place to display any of the 6 texts, depending on which button is rolled over.  Can this be done?
    I probably haven't quite got my head round layers, and this may be very simple, but could someone please point me in the right direction, even if it is a link to the right bit on product help?
    Because the button disjoint rollover doesn't work, I have created 6 slices for the triggers.  I tried hotspots first, but couldn't use them as I also want a rollover live filter effect on the trigger.

    Yes, you can trigger different slice contents on rollover from multiple other slices.
    It's easier to show than describe, so here is a sample file that does what I think you're looking for:
    (1) six buttons
    (2) each button has unique text
    (3) each button has a rollover state
    (4) unique text is displayed in the same place for each button on rollover
    Hope this helps!
    Dave
    Right-click and save the image below - it's a Fireworks source file:

Maybe you are looking for