Searching tables - C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • StephenJ
    New Member
    • Sep 2008
    • 1

    Searching tables - C#

    I have a screen displaying a list of items.

    How is it possible using C# to have the user enter a field and search for something like an item code?

    Does anyone have any good practical ideas?


    Steve J
  • adityakoppolu
    New Member
    • Sep 2008
    • 17

    #2
    will you please provide little bit explanation with an example. Why bcoz i didnt get clearly.

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      "Displaying a list of items"... How? ListBox, Gridview, a bunch of lines in a multi-line text box?

      Where does this list come from? User entered, Database, text file....

      How you search is completely dependent on how you *store* the data. If the data is from a database, then you have to do a query of the database rather than search your on-screen control. If its just a bunch of lines in a text file you need to search all the text (not the best storage method)

      As another person mentioned recently in response to a different question (and I'm paraphrasing... )
      1) Take some time to *think* about your project.
      2) Actually *design* the project before you type a single thing. This means answering questions like "If I need to search data, then how should I store it?"
      3) Now *think* about the *design*. What have you left out? What have you overlooked? When the trained-chimp user enters entirely wrong data into every possible field then clicks "go" will your program be graceful about it or crash?
      4) Now start coding.

      I find that I design from the top down, but code from the bottom up. Meaning I think about overall needs and the big picture first, then break it up into smaller and smaller pieces, then divide those, then divide those. But... When writing the code I start with the smallest pieces first, then the larger pieces that use those smallest pieces, then larger and larger. If each tiny piece can take care of itself, know all its own properties and how to handle itself for... saving data or resizing itself, then the larger pieces don't have to do for them. So the big pieces just have to make a new WidgetObj.cs object, period. Just make it and let the widget handle all its own needs. But hey, that's just me. Ask 1,000 people and you'll get 1,000 different styles of coding practices. That's where the art comes in to the science.

      Comment

      Working...