DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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 08:49 PM.

Similar Threads

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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links