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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

'One-to-One' always a bad idea?

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :Sql Server

I keep reading that a one-to-one relationship in a database is poor design, however I have a situation that to me seems natural.  In my logic I have two classes that inherit from a base class.  So both classes share a core set of properties that are mapped into a base table.  However, the extended properties are of course different for each extended class, so then I created separate tables for each type, and mapped to the base table via a one-to-one relationship.  So an instance of either class gets an entry in the base table, then another entry in one (but never both) of the extended tables, depending on it's specific class type.

To me that makes sense to have the database neatly follow the same lines of inheritance/separation in the logic.  But again everyone says one-to-one is bad.  Is the common approach just to put everything in one table, then null out any property that doesn't apply?

View Complete Post

More Related Resource Links

i need clear idea and explanation about view state


can any one please explaine me about view state property, i need the basic thing, what is it actually, and why we use, wthat is the use of it. and etc etc plsssssssssssssss

Need an idea.

I have a scenario like:I have already created a website, there is facility of EMAIL .Like inbox,outbox,Sent items and many other optionsWhen user login into his account these facilities can be seenI have the new requirement thatI have to log the user activities.I mean to say whenever user uses any option it must be logged in a table.for example:If user enters in to the InboxI have to store the information in the database likeUSERID ,Inbox,Dateand timeSimilarly if user enters SentmailI have to store the information in the database likeUSERID,SentItems,Dateand timewith minimal amount of coding how can i do it?

WF 4.0 Basic Idea

HI, I have 10 million records and I want to loop thru all of them and check for some logic. I need to do this using WF 4.0. Which is the best approach to do this? Any suggestions Thanks.

Please Give me an Idea

Dear Members,              I have two webforms.              1.Home.aspx(It have one button)      2.Products.aspx <asp:Button ID="ButtonProducts" runat="server" Text="Products" PostBackUrl="~/Products.aspx"/> I need, If i click the "Products" Button in "Home page"..... >>Then "Products.aspx" should be get displayed on the Home page but with reduced height and width of the "Products.aspx" page.. Please give an idea for this...                              

Any idea about how to do photo capture from webcam and save it to database MsSQL server

i would like to do a project that enable to capture photo from webcam, and record audio from microphone store to database. but the photo and audio store in folder and the database only store the filename. later i set the path and its play back the audio and show the photo.thanks

Deadlock - i guess i have an idea why, but i'd like to make sure.



What happens if form A is waiting on a lock(object) while another thread, which has the lock for this object, performs an A.Invoke(...)?

I have a deadlock and not finding any other explanation i assume this may cause it.

Need an Idea for doing bulk compare and insert


Hi Friends,

I got a scenario where we want to move some 30k records from a staging table to main table while moving we need to compare the columns from staging to history table and insert some new columns along with the columns in staging tables.


I will give one example.

Lets take staging table with scol1, scol2, scol3

Main table have mcol1, mcol2, mcol3, mcol4,mcol5,mcol6

History table have hcol1,hcol2, hcol3,hcol4, hcol5,hcol6

so i wil move the staging table to Main table by comparing columns scol1, scol2, scol3 with hcol1,hcol2, hcol3 and mcol4,mcol5,mcol6 will contain the 1 if values differ or 0 if it contains same value



Suggest me an IDEA


As I am new to Dot net I dont know the best solution for the requirement..

My requirement as follows ....

1) There are 5 dropdowns, If user selects the first one, the items of the second changes according to first selected drop down option

     Like Wise It follows for the rest drop downs..

2)  There are 4 options Emp No only,Id only,Both exists and none exists.When user gives selected last drop down,It have to check whether any record existed in the DB with the same drop downs selections

     If not exists then user has to check the any one of the above option button else the according to the Database entry the option should be highlighten and make rest all disabled. ( Option can be decided by Zero entry in the column if both values are zero's then it is non applicable)

3) According to the above selected option the textboxes which accepts emp No,Id should be readonly that is, if user gave Emp no only option the textbox which takes input for ID should contains value 0 and should be readonly. where as for the textbox EmpNo zero not allowed.

4) Textboxes should be dynamically created. And there should be a strict check for the values entereted by the user. Should not allow user to proceed furthur if there is any wrong input.

5) while entering inputs in between h

need an idea...blur..


i have sample xml data like this..

<?xml version="1.0" encoding="utf-8" ?>
            <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    <wshibahreginqresponse xmlns="http://tempuri.org/">
                             <ACEMSG xmlns="">

Webform Style Idea


Hi guys,

Number of times some of us might have experienced the that while we register at some website or fill out an application form

They ask us to go through number of steps. for example on top of the page

They Say folow steps ( 1 -> 2 -> 3 -> 4 -> 5 ) to complete the application. and each next step gets activted after the first step is complete.

On each step u can save the information and move ahead and finally complete the whole process.

My question is how is these complete process can be made in asp.net ?

One way that I thought is to create 5 different page and redirect after each step/page is completed and validated.

Can anyone give me ideas to do it in smarter ways, it is requirement for enterprise application, so number of enterprise factors are applicable to it ??

Updates not working with self tracking entities - any idea why?




I'm trying to learn how to use WCF, and have been writing a test solution using the open source Chinook database. I wrote a WCF service that returns the artists, and a winforms client that displays them in a list box. I now want to be able to update the artist name, but can't get it to work.

The code in the Click event handler for the Update button looks like this...

ChinookWcfServiceSTE.ChinookWcfServiceSTEClient client = new

ChinookWcfServiceSTE.Artist artist = client.GetArtist(m_ArtistID);
artist.Name = txtName.Text;
//artist.ChangeTracker.State = ChinookWcfServiceSTE.ObjectState.Modified;


The UpdateArtist() code in the service looks like this...

 UpdateArtist(Artist artist) {
(ChinookEntities ctx = new
 ChinookEntities()) {

i have no idea on charts and i have an requirement of child growth charts pls any help


i have no idea on charts and i have an requirement of child growth charts pls any help

am using visual studio 2008, how to get a chart control and how to use it and

any examples for growth charts

thank u

pls some body give me some idea


I have an xml file like this.


<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Edited by XMLSpy® -->



<cell1>Row1 cell1</cell1>

                <cell2>Row1 cell2</cell2>



<cell1>Row2 cell1</cell1>

                <cell2>Row2 cell2</cell2>



and i am using xslt to display this data like.....

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0"
<xsl:template match="/">

Estimate and Job Process application development idea


Hello all,

I am trying to develop one application, which will serve the purpose of estimation and job process management system. For estimation, I have category, subcategory and product. Estimate has different types. Each product has different properties.

At the time of estimation, user selects the product based on subcategory. Based on criteria and input, new value generated for each time for same product. Now I have to save this all products into estimate table. One estimate has multiple products.

After estimate approved, job will be created based on estimate. Job will take input all the items/products from estimate and then process each item.

My question is what is best way to do this?

Should I keep only one table estimate-detail(like order-order details scenario) which has all selected products and use it at the time of job process? Or Should I create another table for job detail?

I am novice in asp.net and searching best practices for this kind of application? Please try to describe in detail.

Thank you for your time!!!






Business idea Luke Peters

Luke Peters is the owner, founder and president of Air & Water, Inc. Founded in 2002, Air-N-Water.com is an online website retailer focused on meeting the heating and cooling needs of its customers.

pl give me an idea...



Hi, i'm trying to fetch data from xml in the sql query. pl. give a look into this.. 

DECLARE  @xmlDelete xml


@xmlDelete =


<row FSFF_FeesItemID="185" FSI_ID="104" />

<row FSFF_FeesItemID="187" FSI_ID="104" />

<row FSFF_FeesItemID="187" FSI_ID="105" />





r_set AS

Should I Use a Group, Role or Better Idea



So I created a new database and in the first test deployment we end up with some permissions troubles. The DBA assigned says well that's because you forgot to add the role XYZ and then add the users to that role. OK I can add that to my script but...then my script is invalid the first time we hire / fire someone. As I understand it roles are database level. Wouldn't it be better to add a group which would be server level. Add all the users to that group...or better yet the NT Group then my script can create the role and add the GROUP thus my script does not go out of date with every personnel change?? There may be a better way than this even so feel free to expound upon the topic.



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