473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String, Array, DataGrid Question?

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!
Nov 16 '05 #1
2 1706
This most likely won't help you, but it details a packing order for minimizing
the amount of space
required to store your series. If you are just looking for a perfect match, you
can even compare
the permutation identity instead of comparing each item independently.

http://weblogs.asp.net/justin_rogers...23/246815.aspx
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Leon" <vn*****@msn.co m> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
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!

Nov 16 '05 #2
match is not my biggest problem, but just the best way to store the number
sets and how to read them into the datgrid.
"Justin Rogers" <Ju****@games4d otnet.com> wrote in message
news:eL******** *****@TK2MSFTNG P11.phx.gbl...
This most likely won't help you, but it details a packing order for
minimizing the amount of space
required to store your series. If you are just looking for a perfect
match, you can even compare
the permutation identity instead of comparing each item independently.

http://weblogs.asp.net/justin_rogers...23/246815.aspx
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Leon" <vn*****@msn.co m> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
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!


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4577
by: Lance | last post by:
Hi All, Suppose I have a dynamic string array Dim sa(,) as string I want to populate the first two columns of a datagrid control with the two columns of sa. I want the third column of the datagrid control to be check boxes, indicating whether the value should be considered as a string or a double. Any suggestions will be appreciated.
4
7285
by: emma middlebrook | last post by:
Hi Straight to the point - I don't understand why System.Array derives from IList (given the methods/properties actually on IList). When designing an interface you specify a contract. Deriving from an interface and only implementing some of it means something is wrong: either the interface specification is wrong e.g. not minimal or the derivation is wrong e.g. the type can't actually honour this contract.
3
2691
by: Pol Bawin | last post by:
Hi All, One : I have a property that get/set a array of an abstract class A By default my array is null In the propertygrid, It is not works correctly when my array is null. (when my array is initialized with one element it works fine) But I can not change the initial state of the array. It must be null. what must I change.
0
1480
by: Jeb Bushell | last post by:
I am building a wrapper for a multi-dimensional array so that it will bind to a datagrid. I'm starting with a 1-D string array and already the bind works, sorta, but the datagrid is populating with the lengths of the array items, not their values. Debugging in VS is unhelpful because it only shows correct string values in the variables, never their lengths. I code the IList.Item property as ***************** public object this
1
2443
by: codymanix | last post by:
How can I bind a string-Array to a DataGrid? I've already set the MappingName in the to DataGridTablestyle to "Array", but the Grid seems to display only Garbage: Lenght| -------| 13 9 3 3
32
14837
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
2
2091
by: Pete Nelson | last post by:
Does anyone know of a way to bind a string collection to a datagrid? Basically, I have an object, CreditPlans, and a string collection, ModelNumbers. I'd like to bind the ModelNumbers collection to the datagrid, but because there isn't a custom object with properties, just a string object, I'm not sure how to reference it in the datagrid. FYI, I can enumerate through the collection... foreach(string modelNum in...
3
2316
by: AFN | last post by:
I need to manually create the data to be shown in a datagrid (or some data table object). Should I create an array and bind the array to the datagrid OR should I create a temporary dataset and bind that to the datagrid? I have never done either (usually I get a recordset from a stored procedure and bind results directly). I also don't know which is faster. Whichever you suggest, can you give a couple lines of sample code? Thank...
4
1444
by: Lance | last post by:
Hi All, Suppose I have a dynamic string array Dim sa(,) as string I want to populate the first two columns of a datagrid control with the two columns of sa. I want the third column of the datagrid control to be check boxes, indicating whether the value should be considered as a string or a double. Any suggestions will be appreciated.
10
2382
by: Lyners | last post by:
Hello all, I have an ASP.NET website where one of my pages contain javascript that is a check to see if anydata within a datagrid has changed. My problem is that it takes a considerable amount of time to populate the array in the javascript after the datagrid is populated. What I am thinking of doing is creating a comma delimited string on the server side (.vb) and then have the javascript pick it up through array().... My problem...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.