Click here to Skip to main content
15,895,746 members

Comments by UD(IA) (Top 24 by date)

UD(IA) 1-Dec-13 9:57am View    
Thank you very much
UD(IA) 1-Dec-13 6:27am View    
ok than tell me good and better way to do this thing...and where i can find new ways to learn asp.net with c#
UD(IA) 1-Dec-13 5:26am View    
these function use because i want to store date and time according to me and these function change datatime as i need and i store date in database in varchar(8) and when i print i use funcation to add / and when i use from date.now() than it convert it into withoutslash and as according to me so plz tell me errors i can provide its vb format which work correctly is
Private Function Dt_mdy2ymd(ByVal w_dt As String)
Return w_dt.Substring(6, 4) & w_dt.Substring(0, 2) & w_dt.Substring(3, 2)
End Function
Function My_D2sYMD(ByVal w_date)
Dim Ret_Val As String
'If ValidateDate(w_date) Then
Ret_Val = n2s(Convert.ToDateTime(w_date).Year, 4) & n2s(Convert.ToDateTime(w_date).Month, 2) & n2s(Convert.ToDateTime(w_date).Day, 2)
'Else
' Ret_Val = ""
'End If
My_D2sYMD = Ret_Val
End Function
Function n2s(ByVal w As Single, ByVal n As Integer)
Dim Ret_Val As String
Ret_Val = "0000000000" & w
Ret_Val = Ret_Val.Substring(Len(Ret_Val) - n, n)
Return Ret_Val
End Function
Private Function Dt_YMD2DMY(ByVal w_dt As String)
If Len(Trim(w_dt)) = 8 Then
Return w_dt.Substring(6, 2) & "/" & w_dt.Substring(4, 2) & "/" & w_dt.Substring(0, 4)
Else
Return ""
End If
End Function
Private Function Dt_YMD2MDY(ByVal w_dt As String)
If Len(Trim(w_dt)) = 8 Then
Return w_dt.Substring(4, 2) & "/" & w_dt.Substring(6, 2) & "/" & w_dt.Substring(0, 4)
Else
Return ""
End If
End Function
please tell me where is the problems in conversion
UD(IA) 25-Nov-13 18:36pm View    
'ddl_editOffice' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

i got this type of error when i try to do this
office_Cd="01"
Dim sql1 As String = "select * from Office_Mast where Office_Cd='" & officeCd.Trim & "' order by Office_Name"
Dim cmd3 As New SqlCommand(sql1, conn)
Dim dr1 As SqlDataReader
dr1 = cmd3.ExecuteReader
ddl_editOffice.DataTextField = "Office_Name"
ddl_editOffice.DataValueField = "Office_Cd"
ddl_editOffice.DataBind()
ddl_editOffice.Items.Insert(0, "--Select--")
If dr1.IsClosed = False Then dr1.Close()
ddl_editOffice.SelectedValue = officeCd
UD(IA) 25-Nov-13 17:42pm View    
i do this but not work..
Dim office1 = read1("Office_Cd").ToString()
ddl_editOffice.SelectedValue = office1