I create a column in my database call the store string path of file locations.
This column is FileUrl.
I know I can do this in LINQ to get a list of files
from f in Directory.GetFiles((@"c:\temp"))
select f;
to get the list
How can replace the ((@"c:\temp")) with ((FileUrl))
Learning is awesome.
from p in Patients
from f in Directory.GetFiles((p.FilesUrl))
select f
I get this error
"Method 'System.String[] GetFiles(System.String)' has no supported translation to SQL."
my query
I understand, yet I am not able to do. Here is example of my form mvc.
I have a table grid with data link to select row with data new @Html.ActionLink("Details", "Details", new { id = item.PatientsId })
var pat = (from u in _db.aspnet_Users
where u.UserName == User.Identity.Name
join d in _db.Doctors on u.UserId equals d.UserId
join p in _db.Patients on d.DoctorsId equals p.DoctorsId
select
new PatientsModel
{
PatientsId = p.PatientsId,
ClientID = p.ClientID,
DOB = p.DOB,
Gender = p.Gender,
Handedness = p.Handedness,
RecordingDate = p.RecordingDate,
TimeRecording = p.TimeRecording
}) }).SingleOrDefault(i => i.PatientsId == id));
I need to add
FileUrl = p.FileUrl
which is where the string value for the file location.
When a user select detail view
I have
@foreach (var name in Model) {
- @name
}