String, Array, DataGrid Question?

  • Thread starter Thread starter Leon
  • Start date Start date
L

Leon

Ok I have six textbox controls on my web-form that allows the user to enter
the numbers 1-47 non-duplicates in each box ("meaning if the user enters 3
in one textbox they can't enter 3 in another"). However, I'm trying to
figure-out the best way I could allow the user to insert their distinctly
six selected number ("in which six number between 1 and 47 equals a set")
into a database in which my form also contain a data-grid control which
allows the user to view, edit, and delete their previous posted numbers. On
the backend, I need to be able to search through these sets ("being the user
sets") and look for matches to my backend selected six number set.



First, is it best to store the user set of six numbers in the database as.

NumID-PK, Num1, Num2, Num3, Num4, Num5, Num6

{1-PK, 1, 35, 23, 5, 4, 17 respectfully in each columns in the row in the
database} or.

NumID-PK, NumSet

{1-PK, 1, 35, 23, 5, 4, 17 respectfully stored separated by commas in the
column in the database}?



Second, when I read the user set of numbers from the database to my web-form
data-grid should I read them first to an array then to the data-grid or
directly to the data-grid?



Extra Information:

I also thought about storing the set of six numbers as a string of twelve
numbers ("013523050417") then when reading the number form the database to
the page separate the string after every two literals then read them to the
data-grid.



Please weight in on the best way to handle this situation, and if you would
fully explain your solution. Thanks!
 
match is not my biggest problem, but just the best way to store the number
sets and how to read them into the datgrid.
 
Back
Top