You must Sign In to post a response.
  • Category: ASP.NET

    convert datetime to string.. Please guide (MVC)/EF

    rv.PreviousReport = (from data in t.tbreports
    where data.patientid == "100"
    select new SelectListItem()
    Text = data.dateofreport.Value.ToString("dd/MM/yyyy"),
    Value = data.dateofreport.Value.ToString("dd/MM/yyyy")

    dateofreport is a datetime field in table. I have to use the 'date' in this field as 'Text' and 'Value' in the dropdownlist

    if i directly write 'Text = data.dateofreport' i am asked to convert datetime to string however, i am unable to do this conversion in the above mentioned way ...

    I have to set dateofreport as TExt and value both of the dropdown! PLEASE guide
  • #764014
    view these tutorial


    Delete Attachment

  • #764015
    these tutotial may help you


    Delete Attachment

  • Sign In to post your comments