Formatting Date/Time


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Formatting Date/Time

  1. #1
    Join Date
    Jun 2007
    Location
    Oregon
    Posts
    14

    Question Formatting Date/Time

    I am using VB.net 2005. I have an issue formatting a datetime. it tells me that 'Format' is a type and cannot be used as an expression.

    check code any help greatly appriciated.

    Dim CurrentTime As String
    CurrentTime = Format(DateTime.Now, "g")

    If Me.SCHEDULEDDIPTIMETextBox.Text = CurrentTime Then
    Dim SelectedRowView As Data.DataRowView
    Dim SelectedRow As BasketReportDataSet.DIPSTATUSTIMESRow


    SelectedRowView = CType(DIPSTATUSTIMESBindingSource.Current, System.Data.DataRowView)
    SelectedRow = CType(SelectedRowView.Row, BasketReportDataSet.DIPSTATUSTIMESRow)

    Dim NewRackLoader As New RackLoader
    NewRackLoader.LoadRecord(SelectedRow.ID)
    NewRackLoader.Show()
    Else
    End If
    Thanks,

    MO

  2. #2
    Join Date
    Jan 2007
    Posts
    112
    I'm not sure why it's not working, it worked for me when I tried it. This will do the same thing however.
    Code:
    CurrentTime = DateTime.Now.ToString("g")
    **EDIT**
    I reproduced the error by creating an 'enum' called 'format'. More then likely you've used 'format' to name something like an enum or class/structure.
    Last edited by TwoFaced; 06-26-2007 at 09:49 PM.

Similar Threads

  1. Replies: 1
    Last Post: 06-04-2007, 05:19 PM
  2. Currency Formatting
    By RonH in forum .NET
    Replies: 3
    Last Post: 04-11-2007, 02:48 PM
  3. Reporting Services 2005 Formatting issue
    By asifhameed1 in forum Database
    Replies: 2
    Last Post: 09-26-2006, 12:29 AM
  4. Access Date/Time Field
    By Jeremiah in forum VB Classic
    Replies: 2
    Last Post: 03-07-2001, 09:18 PM
  5. Formatting Text with XML
    By Liz in forum XML
    Replies: 4
    Last Post: 07-18-2000, 05:21 PM

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