Hi

How do I format a datetime column from a table for display in a textbox. Here's my code
VB Code:
  1. Dim conn As SqlConnection
  2.    Dim cmd As SqlCommand
  3.    Dim connstring As String         Dim cmdstring As String
  4.    Dim rowsaffacted As Integer
  5.    Dim oAdapter As New SqlDataAdapter()
  6.    Dim oTable As New DataTable()
  7.    connstring = ConfigurationSettings.AppSettings("connectionstring")
  8.    conn = New SqlConnection(connstring)
  9.    Try
  10.     conn.Open()
  11.     cmd = New SqlCommand("SELECT * FROM vmvsurvey where id = " & _id.ToString(), conn)
  12.     lblStatus.Text = "SELECT * FROM vmvsurvey where id = " _
  13.                            & _id.ToString()
  14.      oAdapter = New SqlDataAdapter(cmd)
  15.      oAdapter.Fill(oTable)
  16.  
  17.      ' This is where I'm having trouble
  18.      txtDate.Text = oTable.Rows(0).Item("surveydate")  
  19.    Catch sqlex As SqlException
  20.        lblStatus.Text = sqlex.ToString()
  21.     Catch ex As Exception
  22.        lblStatus.Text = ex.ToString()
  23.     Finally
  24.        With conn
  25.           If .State <> ConnectionState.Closed Then
  26.               .Close()
  27.           End If
  28.        End With
  29.        conn = Nothing
  30.    End Try

The date value is currently displayed as 07/02/2003 15:18:00 but I would like it to be displayed as 07/02/03. I tried many formats etc. but can't seem to find the right approach. I can bind the textbox to the datasource so that's already out.

Thanks