.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Help with design choice -- selecting parts for ordering table

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :ASP.Net

The next part of what I'm working on will involve adding parts to an order, and will be more complex than probably anything I have done.

The amount of parts to choose from will be very extensive.

Anyone care to plant the seed,  have an example, or helpful input on easy ways to select the parts,  add them to a temp table/data table/data set, until all parts are selected (?), and insert into the database when done?

Dropdowns would, in cases, have a large amount of items. Select items from a gridview Master/Detail style? Checkbox lists?

I'm not looking for code, just a point in the right direction. I've looked at some shopping cart/e-commerce type designs, but it just doesn't fit what I'm trying to do very well.



View Complete Post

More Related Resource Links

can alias in select be used for selecting other column in that table?

Hi All,I want to use an alias name in a select clause to select other column in that table? select   top 1 (   case when CreatedByName <> '' then 'yy'         else 'xx' end) as filName, (filName + 'xx')from Order       But it throws error like " Invalid column name 'fileName'."Could you please help me out?

Selecting different no. of records from the same table

Hello all, This might seem a basic thing but bothering me from last few days. Suppose I have a table containing 5 million records and I am running queries one by one (one query executes completly and then next query is fired)as below on that table. SELECT top 20000 FROM MyTable SELECT top 200000 FROM MyTable SELECT top 2000000 FROM MyTable  Now my questions are; Will SQL Server use same execution plan? As I am running these queries one by one in same order as given above, will second query take less time than it should if run standalone (only second query is fired, no query fired before that) and similarly will third query take less time than it should if run standalone (only third query is fired, no query fired before that), since there is a possibility of same execution plan being used?  Regards.    

Display specific table from the start vs selecting from a list.

Hello all, I'm using VS2010, EF 4.0. I want to display a list view from a specific table from the start -instead of the standard default page that list all the tables. Any ideas are welcome. 

Best table design for modelling a 1:0..1


Hi Gurus,


Apologies if this isn't the right place for this kind of question but I felt sure you guys would know the answer to this fairly simple design question.


I would like to model an item and a subject entity.  

An item can be assigned to zero or at most one subject.  

A subject may consume zero or one item.


How would it be best to model this kind of relationship in the database?  I was originally thinking of having an item FK in the subject table but that would potentially allow multiple subjects to be assigned the same item.  Then I was thinking of having a subject FK in the item table that would force only one subject to be assigned 1 item.

I think I'm just going round in circles here and it may be that my business logic should take care of these issues.  


My question is how is it best to model this kind of relationship?


Kind regards

How to create a Table of content in .rdl design in BIDS.



well am having a problem on.

How to create a Table of content in .rdl design in BIDS. either it should be dynamic or there should be bookmark of each section in TOC.

can any one help me out.?..



How to create a Table of content in .rdl design in BIDS dynamically according to the Page no wise..?



well i am able to create the TOC statically by using the Document Map properties as describe in my older post issue 

but now i just want to create the Table of contents dynamically generate using the page no wise..is it possible...how can we do it while designing the .rdl in BIDS..



Updating the design of an SQL table


guys i would like to update the design of a table.

Trying to save the design i am getting an error that the operation isn't permitted.

A constraint exist between this table and another table

any idea ? thanks


Which table design is good for performance?


hi All,

I have situation to create table with datetime column for OLAP (more select stmt.) database with following conditions,

1.       Need to insert only date (no need time)

2.       Only SQL Server 2005 or less can be used.

3.       More than 10 million records capacity of the table.


use tempdb
drop table T1;
drop table T2;
create table T1(col1 int, colD tinyint, colM tinyint, colY smallint);
create table T2(col1 int, colDate datetime);
insert in

Thoughts on table design?


We are building a new OLTP database that has a design consideration that I am looking for feedback on. that consideration is tracking history of change on every row of every table in the design. CDC has been ruled out because its missing some feature that is needed.

My first thought for tracking history is to use triggers to capture changes to an audit table. however, the current design uses the stored procedures that insert/update rows to write to the audit tables. basically the current row is queried for and stored in a temp table...then a hash is created on the row...a hash is created on the new row and if they are different a row goes into the history table and the row is updated.

(i think this is bad design as the same code would have to be repeated for each procedure written that updates a table, and you have about 20-30 lines of code cluttering up every stored proc. for some reason some developers think triggers are evil though because they are "hidden")

the second thought on these history tables is that a row should be entered into the history table on insert of a row AND on update...the update should insert the new value.  I find that most people only want to store the old value of the changed record and not the new value.  the reason i would store the new value is so you dont have to look in 2 tables to find what a recor

CURSOR performance on multiple delete/insert and maybe poor table design


We have table documents and table documents_additonal_data, joined via key (docnum, doctype), important to know is that in documents_additonal_data we just have two more fileds valuetype and value (varchar(MAX)), and every record in doc can have variable 0-n valuetypes so there is no schema enforced in any way.

Now I've made cursor that needs to transfer history data from one older table to docs, must use cursor with order by clause because transaction_id, some bussines logic etc.  In short it takes values, have some IF logic on cursor variables, checks if there is already record for that document, some more IF logic on variables (with few simple selects) and calls insert procedure.

About insert procedure, it doesn't update values but reads current, stores old to XMLvalue (xml made with select) in storage table, deletes current, and inserts new data, reason for that is probably multiple indexes  (docs is primarly 'read from' table) and millions of records, update was slower probably because in add_data on update it usually needs to delete, insert, update in the same time. Insert procedure takes XML parameter for additional_data which is then translated and inserted via exec sp_xml_preparedocum

selecting a percent of a table and similar records



I have a piece of sql code that selects the top 10% of a table. See below a sample of the database table


And this is my code

       CONVERT(VARCHAR, (CONVERT(FLOAT, Points)/CONVERT(FLOAT, totalpoints))*100) + '%' PercentPoints   
FROM   (SELECT *,   
               SUM(points) OVER() totalpoints   
            FROM  tests.dbo.tester4)A    
Order by Points desc


So what this code does is add up all the points in the points table, (also works out what percentage of the points each user has) and then displays the top 10%, which in this case will give me "John" and "Dave"

So what I need the  sql to do is check if any other records in that table have the same number of points ast the last selected record, and to select it to.

So in the above table, the code shoud return  "John", "Dave" and "Mark" as Dave and Mark are on the same amount of points.  Does anyone know how I can do this?

Sorry if this is not clear

Selecting from table where value is in results from a sproc


I'm stuck again! I cannot get the following to work - hopefully it will be self-explanatory on what I am trying to achieve. Any suggestions please? Smile

select * from TABLE where [Value] in (execute dbo.spProcedure 'param')

Insufficient Permissions to alter table in SSMS Design View, can run ALTER Table successfully

Hello, are the permissions in the object explorer in management studio different for a login than what can be run in a query window for the same login? I have a developer I gave ddladmin so he can create/modify tables. He can open the table in design view in object explorer (gets a warning about possible insufficient permissions when he opens) but when he tries to add a column it fails with a permissions error. He scripted off the change and ran it in a query window, which worked fine. Any insight would be appreciated. Thanks.

SQL 2008 create table relationship design failure

i want to make three tables and relationship on design time. Cutomer has many orders and each order has many items. CustId is primary key for Customer table, OrderId and CustId are primary key for Order table, OrderDetId and OrderId are primary key for OrderDet table. Customer and Order tables has relationship one to many by CustId, Order and OrderDet tables has relationship one to many by OrderId. I can not make this on design time. gettting error on SQL 2008 "The Column in Order table do not match an exisintg Primary or Unique key constrains."

Abstract Factory Design in C# , Vb.NET

Provide an interface for creating families of related or dependent objects without specifying their concrete classes

Prototype Design Pattern in C#. Vb.NET

Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype

Adapter Design Pattern in C#, VB.NET

Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend