Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011
    Posts
    6

    Unanswered: Will you help me with MSSQL Syntax in VB?

    This query I had to modify because the MIMETYPE was "audio/x-mpeg" instead of "audio/mpeg". It was just a temporary fix because I need it to find all the mpeg types, I think there are about 10 of them. I can't seem to find the syntax to make the query look for anything that begins with "audio/" or to check a set of values for true.

    Can you help me with my ignorance?

    Dim db As New DAL.AllstarRadioDataContext
    Dim Content = (From c In db.fs_Contents _
    Where c.ProgramID = _ProgramID _
    And c.DisabledBy Is Nothing _
    And c.fs_ContentFiles.Count > 0 _
    And c****nDate <= Date.Today _
    And c.fs_ContentFiles.Where(Function(f) f.FileMIMEType = "audio/x-mpeg").Count > 0 _
    Order By c****nDate Descending).Take(1).FirstOrDefault

    If Content IsNot Nothing Then
    'load player

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Records where your_field starts with audio/:
    Code:
    WHERE  your_field LIKE 'audio/%'
    George
    Home | Blog

  3. #3
    Join Date
    Jul 2011
    Posts
    6
    This is what worked.

    And c.fs_ContentFiles.Where(Function(f) f.FileMIMEType.Contains("audio")).Count > 0 _

    Same idea. Thanks.

    Ken

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •