Dim conn As New SqlConnection(Web.Configuration.WebConfigurationManager.ConnectionStrings("UserManagement").ConnectionString) Dim comm As New SqlCommand Dim adpt As New SqlDataAdapter Dim result As New DataTable comm.CommandText = "SELECT SUBSTRING(HIJRI_DATE,7,2) AS DAY,SUBSTRING(HIJRI_DATE,5,2) AS MONTH,SUBSTRING(HIJRI_DATE,1,4) AS YEAR FROM TABLE1 " comm.Connection = conn adpt.SelectCommand = comm Try adpt.Fill(result) DDL_Day.SelectedValue = result.Rows(0).Item("DAY").ToString DDL_Month.SelectedValue = result.Rows(0).Item("MONTH").ToString DDL_Year.SelectedValue = result.Rows(0).Item("YEAR").ToString Catch ex As Exception Throw ex Finally conn.Close() End Try End Sub
Dim column1 As New DataGridTextBoxColumn With column1 .MappingName = "fieldName" .Format = "yyyy/MM/dd" End With
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)