Trying to change a dataset.table.row.item value


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Trying to change a dataset.table.row.item value

  1. #1
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259

    Trying to change a dataset.table.row.item value

    Hi , I'm trying to change a dataset's item's value but cant seem to be able to do it instead it keeps the same value in the dataset.table.row.item . What I'm trying to do in my code is get back a dataset (which has date and time information in one of the cells) and go through each row and change the cell that contains the date/time data to just contain the date information by splitting the date and time based on the space between them and then retaining the first index of the returned array and setting that value back in that dataset.table.row.item .

    HERES MY CODE :
    While dateCounter < dset.Tables(0).Rows.Count
    strDate = Split(dset.Tables(0).Rows(dateCounter).Item(3).ToString, " ")
    truncatedDate = strDate.GetValue(0).ToString
    dset.Tables(0).Rows(dateCounter).Item(3) = truncatedDate
    dateCounter = dateCounter + 1
    End While

    then after all that , I still get the date and time ! help , this is in .net 2.0

  2. #2
    Join Date
    Jun 2004
    Location
    Pakistan
    Posts
    292
    After scratching my head about 7 times (and each times = to a new way of doing this), I can only say that by default .net engine wants to stick its "midnight 12AM" timer in there.
    What exactly do you want to do with saving the field as date only? If it's just to display could't you use one of the to string method for Date class or do you have any restriction over that?
    new to programming but getting ther

  3. #3
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259
    Quote Originally Posted by kashif_82
    After scratching my head about 7 times (and each times = to a new way of doing this), I can only say that by default .net engine wants to stick its "midnight 12AM" timer in there.
    What exactly do you want to do with saving the field as date only? If it's just to display could't you use one of the to string method for Date class or do you have any restriction over that?

    yes its just for display , cause in sql server you get that 12am attached to any date that was entered . So Im just trying to only display the date

  4. #4
    Join Date
    Jun 2004
    Location
    Pakistan
    Posts
    292
    Well if it is for display only, then why not use CType(whatevercontrol.text, Date).ToShortDateString ???
    As I mentioned above, I am not sure if there are limitation/reason to why you are not choosing this method.
    new to programming but getting ther

  5. #5
    Join Date
    Aug 2006
    Location
    PA
    Posts
    259
    Thanks dude

Similar Threads

  1. change the date in the file.
    By vino in forum VB Classic
    Replies: 0
    Last Post: 03-01-2006, 08:48 PM
  2. How to change COM port number
    By quantum1976 in forum VB Classic
    Replies: 1
    Last Post: 02-17-2006, 11:29 AM
  3. How to generate Make Files?
    By aMax in forum Java
    Replies: 2
    Last Post: 08-04-2000, 06:55 PM
  4. Replies: 6
    Last Post: 03-25-2000, 01:29 PM
  5. Replies: 0
    Last Post: 03-23-2000, 02:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center