Showing posts with label items. Show all posts
Showing posts with label items. Show all posts

Friday, March 9, 2012

Need a way to handle multiple selections

I have a webform that lists all items (codes) on the left and selected items (codes) on the right. A user selects an item on the left and clicks a button to move it to the right side. An update changes the bit from 0 to 1. This uses the bit column in the table to determine what is listed on the left (0) or right (1) sides.

Then I can filter in my stored procedure on the bit column WHERE (dbo.tblCodes.CodeSelect = 1)

My problem with this is that if two or more users are doing this process on different sessions, they can trip over each others selections.

I'm hoping someone has a suggestion on how I might avoid the users having this problem.

Arent you storing the selections into a temp table before you update the actual tables?

|||

No, the user selects a code from a listbox on the left and clicks a button. This button calls a stroed procedure that changes the bit column of that code to 1 and then on postback it is moved to the right side. Once they have made all their selections another stored procedure is called to get the data based on their selection.

The update procedure looks like this:

ALTER PROCEDURE [dbo].[CodeSelectOne](@.SelectOneint)
AS UPDATE dbo.tblCodeLookup
SET [CodeSelect] = 1
WHERE (Code_ID = @.SelectOne)

I think my issue is in the next procedure that returnes the data to the user. That procedure uses a where clause WHERE tblCodeLookup.CodeSelect = 1, I think this is where I run into trouble. If another user changes the selected codes before this first users data is returned then they will not get there expected data.

Any suggestions?

|||

What if I had a multiselect listbox and put a comma delimited list of codes in a session varaible and then pass that to my stored procedure in a correlated subquery using an IN?

Any thoughts on this?

Need a Suggestion for creating Tables ?

One of my Customer deals in different Items, and every Item has different
specifications and types.
For example:
Item A has different categories, types, colours
Item B has different colours, sizes, thickness, weight
Item C has different colours, qualities, yarn counts, widths, types, weave,
design type
Now how can I create my Product Table(s) which should accomodate all above.
How many tables I have to create, is it possible that I create one or two
tables and use self aliasing, if possible, how ?
One easy way is to create different tables for all the required
specifications, but what, if customer deals with 100s of specifications all
over, and another customer whom I sell this product, deals with another 100
specifications which are totally different than the last customer ?
Please give me your best solutions so that I can easily use these tables in
my Inventory Application, without changing the design again and again.
I hope you understand what I am trying to say ?
I am developing my Application in VB.Net 2005.
Best Regards,
LuqmanSee if this helps. Read about "Entity Supertypes and Subtypes".
http://72.14.203.104/search?q=cache...s&ct=clnk&cd=17
AMB
"Luqman" wrote:

> One of my Customer deals in different Items, and every Item has different
> specifications and types.
> For example:
> Item A has different categories, types, colours
> Item B has different colours, sizes, thickness, weight
> Item C has different colours, qualities, yarn counts, widths, types, weave
,
> design type
> Now how can I create my Product Table(s) which should accomodate all above
.
> How many tables I have to create, is it possible that I create one or two
> tables and use self aliasing, if possible, how ?
> One easy way is to create different tables for all the required
> specifications, but what, if customer deals with 100s of specifications al
l
> over, and another customer whom I sell this product, deals with another 10
0
> specifications which are totally different than the last customer ?
> Please give me your best solutions so that I can easily use these tables i
n
> my Inventory Application, without changing the design again and again.
> I hope you understand what I am trying to say ?
> I am developing my Application in VB.Net 2005.
>
> Best Regards,
> Luqman
>
>|||Any practical example of table(s) and queries will be helpful.
Best Regards,
Luqman
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:7DF777AC-4DE8-4BE0-BB98-946BB6FDC3B5@.microsoft.com...
> See if this helps. Read about "Entity Supertypes and Subtypes".
> http://72.14.203.104/search?q=cache...s&ct=clnk&cd=17
>
> AMB
> "Luqman" wrote:
>