Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Linq to SQL two combobox [modified]

Linq to SQL two combobox [modified]

Scheduled Pinned Locked Moved C#
databasecsharplinq
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mutafa81
    wrote on last edited by
    #1

    we devlop program for big ISP company have 3 SQL table Provider Table [Combobox1] ID Name 1 prov1 2 prov2 3 Prov3 //// Location Table [Combobox2] ID Name 1 Loc1 2 Loc2 3 Loc3 //// End_User Table [Listview1] ID Name Provider_ID Location_ID 1 ab 1 2 2 bc 1 3 3 cd null 1 4 de 2 null //// Actually we add "All Provider" to provider combo also "All Lcoation" for location combo to get all even null. value for both "All Provider" & "All Location" set to 0 I can get fill listview user with specific provider like var user = from s in db.End_User where s.Provider_ID == comboprov.value... slect s foreach(....... this good if all location slected in comoboboxlocation or nonvalue select) i need to fill full four condition in this one statement for Linq to sql A- prov = 2 & Loc = 0(all) B- prov = 0(all) & loc = 1 c- prov = 1 & loc = -1(nothinselect) D- prov = -1(nothinselect) & Loc = 3 something like var user = from s in db.End_User where s.Provider_ID = {"*" @(if combopro.value == 0) || combopro.value} + {s.Location_ID = {"*" @(if comboloc.value == 0) || combopro.value} select s. foreach(....... Thank you...

    modified on Tuesday, November 11, 2008 10:39 AM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups