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. Database & SysAdmin
  3. Database
  4. help required in adding dynamic columns and search anywhere in table ????

help required in adding dynamic columns and search anywhere in table ????

Scheduled Pinned Locked Moved Database
databasecomdesignbusinesshelp
3 Posts 2 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.
  • J Offline
    J Offline
    jarajeshwaran
    wrote on last edited by
    #1

    Hi all, I would like to get your help and guidance in implementing the following requirements. please consider the following situation. We have an address book application. The app will have fields like name/age/Sex by default. I want to give the user the freedom to add his own fields to the application. Like website address/email etc. This wil be decided by the user while the sets up the application for the first time. I have a clear understanding of doing this at the UI level(using dynamic controls to hold the value) how can the same be handled at the database level? Like how should the table be designed to accomodate this dynamic column creation. my second requirement is While we search our inbox in GMAIL using the default search box(not the advanced options) we key in the keyword. And gmail returns the results irrespective of where the search keyword appears( it may be in the subject line/ message body/from email address etc.) I want the same feature be implemented in a windows application( I want the search to be done against all the columns in a given table or given set of tables). www.BeginWithDisbelief.com

    hi hi hi hi

    M 1 Reply Last reply
    0
    • J jarajeshwaran

      Hi all, I would like to get your help and guidance in implementing the following requirements. please consider the following situation. We have an address book application. The app will have fields like name/age/Sex by default. I want to give the user the freedom to add his own fields to the application. Like website address/email etc. This wil be decided by the user while the sets up the application for the first time. I have a clear understanding of doing this at the UI level(using dynamic controls to hold the value) how can the same be handled at the database level? Like how should the table be designed to accomodate this dynamic column creation. my second requirement is While we search our inbox in GMAIL using the default search box(not the advanced options) we key in the keyword. And gmail returns the results irrespective of where the search keyword appears( it may be in the subject line/ message body/from email address etc.) I want the same feature be implemented in a windows application( I want the search to be done against all the columns in a given table or given set of tables). www.BeginWithDisbelief.com

      hi hi hi hi

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Some ideas 1 Traditional solution is to have a number of user defined blank columns on a table and allow the user to name and use them. This limits the number of additional fields to the user defined columns you create. It does make query easier. Another way is to have an attribute type and attribute table where the user can create a type (web address) and create an attribute record for an address where required. This allows unlimited attributes to be created but makes supporting queries more difficult. 2 You are asking for 2 very different things, GMail queries 2 or 3 fields, subject and body, you want to query any field in any table. A simple compound where clause using OR will do that.

      Select *
      From EmailTable
      Where Address like '%searchstring%' or Subject like '%searchstring%' or Body like '%searchstring%'

      J 1 Reply Last reply
      0
      • M Mycroft Holmes

        Some ideas 1 Traditional solution is to have a number of user defined blank columns on a table and allow the user to name and use them. This limits the number of additional fields to the user defined columns you create. It does make query easier. Another way is to have an attribute type and attribute table where the user can create a type (web address) and create an attribute record for an address where required. This allows unlimited attributes to be created but makes supporting queries more difficult. 2 You are asking for 2 very different things, GMail queries 2 or 3 fields, subject and body, you want to query any field in any table. A simple compound where clause using OR will do that.

        Select *
        From EmailTable
        Where Address like '%searchstring%' or Subject like '%searchstring%' or Body like '%searchstring%'

        J Offline
        J Offline
        jarajeshwaran
        wrote on last edited by
        #3

        for the first question do you suggest to me to have a table design as suggested here http://social.msdn.microsoft.com/Forums/en-US/sqlgetstarted/thread/9b781fae-a12d-4405-9a6e-9dd5421b4fc4/[^] Fields FieldID FieldName 1 Website 2 Home Phone 3 MSN (the fieldnames will be user created) Field Values ContactID FieldID FieldValue X 1 Hotmail.com X 3 Abc Y 2 65766786786 Y 1 msn.com have I understook properly. or haven't I :confused: the solution for my second requirement works like a breeze :cool:(yikes why didnt I think of this)

        hi hi hi hi

        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