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

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

trouble with foreign key

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
I have this statement that breaks due to a foreign key constraint. having a tough time figuring out how to get around it: delete   from Security_LoginActivity where   UserClientMetaDataId in ( select   a.UserClientMetaDataId from Security_LoginActivity a inner   join Security_UserClientMetaData b on a.UserClientMetaDataId = b.UserClientMetaDataId where   LoginTraceId is not null ) delete   from Security_UserClientMetaData where   LoginTraceId is not null and LoginTraceId < (   select min(LoginTraceId) + 50000 from Security_UserClientMetaData   where LoginTraceId is not null )   Error is: Msg 547, Level 16, State 0, Line 9 The DELETE statement conflicted with the REFERENCE constraint "FK_Security_UserClientSignature_Security_UserClientMetaData". The conflict occurred in database "ASPNETDB", table "dbo.Security_UserClientSignature", column 'UserClientMetaDataId'. The statement has been terminated.  qeqw

View Complete Post

More Related Resource Links

Trouble with UpdateProgress showing...


Recently I converted a project to VS.NET2010 and ASP.NET 4.0 (not convinced this is the problem, but regardless this is when the problem began) and now I am having an issue with an AJAX UpdateProgress showing. Here is the abrriviated code:

   <asp:UpdatePanel ID="UpdatePanelPostPageLoad" runat="server">
         <asp:Timer ID="tmrPostPageLoad" Enabled="false" Interval="100" OnTick="PostPageLoad_LoadData"
         <asp:Timer ID="tmrPostPageLoadPt2" Enabled="false" Interval="1" OnTick="PostPageLoad_LoadDataPt2"
         <%--Placing the UpdateProgress inside the UpdatePanel targeted--%>
         <asp:UpdateProgress ID="UpdateProgressPostPageLoad" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="UpdatePanelPostPageLoad">
                       Updating blah blah....


Having Trouble Connecting to BDC


Hello Share Point experts,

For the first time I'm trying to connect to BDC in SharePoint. I created the Application Definition File and successfully uploaded it to the page. Here is the Authentication part of my ADF:

    <AccessControlEntry Principal="domain\admin">
      <Right BdcRight="Execute"/>
      <Right BdcRight="Edit"/>
      <Right BdcRight="SetPermissions"/>
      <Right BdcRight="SelectableInClients"/>
    <AccessControlEntry Principal="domain\admin">
      <Right BdcRight="Execute"/>
      <Right BdcRight="SelectableInClients"/>
  <LobSystemInstance Name="CRMDB">
<Property Name="AuthenticationMode"

Trouble with Font Definition in Accordion Control


 VWD 2008 Express.

I have a page on which I have an accordion control.  The accordion control seems to be overriding the font definition I have for the page body in my CSS stylesheet.  Here is what is happening.  Can anyone help?  Thanks.

1.  When I open the page and the top panel opens, it displays with the correct font family, size, etc.

2.  If I close and reopen the top panel, it displays with another font family and looks bad.

3.  All subsequent panels, when opened, display the font in a different family than specified in my CSS stylesheet.

This is what I have in the stylesheet both for the body and for the .accordioncontent:

    background-color: #E4E1C2;
    background: url(../images/background.jpg) repeat left top;
    font-family: Georgia, "Times New Roman" , Times, serif;
    color: #666666;
    font-size: 12pt;
    border-top: none;
    padding-top: 10px;
    font-family: Georgia, "Times New Roman" , Times, serif;
    color: #666666;
    font-size: 12pt;


Visual Studio 2008: having trouble in opening any web page

hi alli am unable to run any web page in the browser that i design in visual studio..i didnt understand that what happened.As the visual studio was working fine and i can easily run my websites that i create in it but now i tried to run different pages in its internal browser,internet explorer,mozilla firefox but they give error(the error which we get when we are not connected to internet and try to open a url).Even i had tried to build a new website and run it but the problem is still..i cant figure it out thats why came here and posted.so can anyone help me out...

Trouble executing ASP.NET app on 64-bit server

Hi,I have an asp.net webapp that uses some unmanaged code and 3rd party pre-compiled libraries that I am pretty sure are 32-bit.  We developed this on a 32-bit machine with a 32-bit development windows server.  Now we are moving our web site to production where the box has Windows Server 2003 64-bit.  I was getting W3SCV errors about the framework at first:http://s18.photobucket.com/albums/b116/dtdono0/DOTNET/ISAPI_002.jpg I followed the instructions on this blog that talks about enabling the 32-bit version of ASP.NET: http://support.microsoft.com/kb/894435Now I get a new error and I cannot find any documentation on it.  http://s18.photobucket.com/albums/b116/dtdono0/DOTNET/ISAPI_001.jpgI looked up the error code 0x000000c1 and got the following:C:\Err>err 000000c1# for hex 0xc1 / decimal 193 :  SPECIAL_POOL_DETECTED_MEMORY_CORRUPTION                       bugcodes.h  SQL_193_severity_15                                           sql_err# The object or column name starting with '%.*ls' is too# long. The maximum length is %d characters.  ERROR_BAD_EXE_FORMAT                                          winerror.h# %1 is not a valid Win32 application.# 3 matches found for "000000c1"This really doesn't tell me much.  Any ideas?

Foreign key constraint not replicating

We have a merge replication setup with one publisher/distributor and several subscribers.  Several of the tables being replicated have foreign key constraints and these replicate without issue.  However, some foreign key constraints that utilize cascading do not replicate.  To make matters worse, some tables with these cascading fk constraints replicate fine while others do not.  Has anyone run across this behavior and is there a fix for it?  The cascades will dramatically reduce our merge conflicts and help maintain the integrity of the data so we need to keep them in place.

How to get all the foreign key references for a primary key

Hi ,  I would like to know all the foriegn key references in the db for a table's primary key..How can i get that? Thanks sunil m datla

trouble with statustrip not visible

for some strange reason the the stusstrip's toolstripStatusLabel got changed to invisble desipte my explicit effort in code to sensure it is visible , brought to front,. the statusstrip itself is visible however. Plateform: c# visual studio 2008 express on windows 7 coul it be I had in teh form: top panel top middle textbox dock=fill botton panel doc k= bottom adn has a textbox docked to its top and statustrip docked to the panel's bottom?

Trouble assigning properties for multiple CSS classes

Hi Can anyone tell me why the first block of CSS below works, but the second one doesn't? Thanks Block 1: (works) <style type="text/css">  .FB  {      margin-bottom: 0.5in;      margin-left: 0.5in;      text-align: left;      float: left  }  .FB  {      color: Black;  }</style> Block 2: (Doesn't work - all I get for FB is color: Black)<style type="text/css">  .SomeOtherClass, FB  {      margin-bottom: 0.5in;      margin-left: 0.5in;      text-align: left;      float: left  }  .FB  {      color: Black;  }</style>

Trouble With Team Foundation Server/Visual Studio 2010

Hi At work we are 2 guys on the same project. We both program in visual studio 2010. The other guy complains that he don't see my changes. I know this dude have already executed "Get Latest Version", despite that he don't get my changes. Some more information that may be relevant:Each time I've done some changes to the source code on my local computer, when I run the code breakpoints are not triggered. I get a message saying something about mismatch between different version of the source (or something like that, weeks sinece I saw that message). It's a while since I saw that message becasue I've found a work-around: Each time I've done changes tothe source code I do this:- Clean Solution- Rebuild (Release)- Rebuild (Debug) When I've done that I can see my own changes.. But the other guy have trouble with seeing my changes. I'm not sure how to fix it so that he see my changes. I checkin regulary so my changes should be available on the Team Foundation Server. Any help on this would be very helpful

Trouble Activating a Solution on a new SP installation

This is a new Sharepoint 2010 server. I have uploaded a very simple solution wsp file and when I try to activate the solution in the Solutions Gallery - the Activate icon is grey-ed under the Commands Ribbon in the popup (entitled: Solutions Gallery - Activate Solution).  On hover over this icon it states that this command is inactivated.  The F2 extended help give a wide range of ideas mainly permissions. I should have full admin priviledges. We checked the services and anything that makes sense is running. This same solution will activate on my local test system - it is a simple visual webpart as a test. Since I am using the same browser for both local and this new server I do not think it is ActiveX. Thanks in advance for any ideas.  

Trouble Installing TFS 2010

    Sorry if i come off as a little bit irritated but i have had a hellacious week. I originally got MOSS 2010 installed with no problem. It installed SQL Server Express 2008 which i didn't like but at least i got it installed (i already have SQL Server Enterprise 2008 R2 installed on this machine).  I then tried to install TFS 2010 and had all kinds of problems. Originally i got some type of error like: [08/22/10,18:08:48] Microsoft Team Foundation Server 2010 - ENU: [2] ERROR:Error 1304.Error writing to file: Microsoft.VisualStudio.QualityTools.CommandLine.dll. Verify that you have access to that directory. Spent the better part of 3 days trying to figure out whats going on. Didn't get much help from the forums so ended up having to figure it out by myself. I uninstalled MOSS 2010 and still got the same error above. I had to remove the application layer ____ that the sharepoint installer installed but didn't remove when i uninstalled the product. I was then able to install TFS with no problem. So apparently sharepoint was blocking something. I then wanted to start all over again so i uninstalled TFS and now of course sharepoint won't install cleanly. I get the following error when trying to install: Error: Command: 'C:\Program Files\Common Files\Microsoft Shared\SERVER14\Server Setup Controller\dbwrap.exe' failed with error code: -2068643839. Type: 8:

Trouble getting my back/forward buttons to work correctly

My program has 4 pages that have session variables on each page and they are retrieved on the 4th and final page then submitted to a database when the submit button is clicked. When i was testing my program i filled out all 4 pages and then clicked back to refill-in something on a previous page and all my information wasn't filled out anymore. So i added the code in the page load sub btnBack.Attributes.Add("onClick", "javascript:history.back(); return false;") and this cured that problem so i could click back and the data would still be filled out. Then i saw a new problem....after i went back to fix something on previous pages 1 and 2, i would click the next button to go forward to pages 3 and 4 that i've already started filling out and now the data on those pages were cleared. So how do i make it so that the information from the whole program stays filled out whether i go back and forth from the 1st page to the 4th until i click submit on the 4th page? I have searched everywhere on the internet and cannot find a solution

Trouble With Calculated Member

WITH MEMBER [Promotion].[Campaign].[Program].[All Others] AS [Promotion].[Campaign].[Program].&[Acquisition]+[Promotion].[Campaign].[Program].&[Publications] SELECT [Measures].[Revenue] ON 0, [Promotion].[Campaign].[Program].ALLMEMBERS ON 1 FROM MyCube In the MDX above "Promotion" is the dimension.  "Campaign" is a user hierarchy.  "Program" is a level/attribute. I keep getting: Query (2, 2) The member '[Program]' was not found in the cube when the string, [Promotion].[Campaign].[Program].[All Others], was parsed. What am I doing wrong here?

Inserting Foreign Key Value if it doesn't exist?

I am inserting a record and want to set the value for a foreign key but I am getting an error - I initally thought that it would insert it if it didn't exist but I must be wrong and want to confirm that I need to check all values and make a record for them if they don't exist... here's what I am trying to do - does his make sense?var newAllPart = new Part();                newAllPart.PartNumber = partNumber;                newAllPart.Manufacturer.ManufacturerName = partManufacturer; // error here if the Manufacturer doesn't exists already                newAllPart.PartType.PartTypeName = partType;                newAllPart.Category.CategoryName = partCategory;                newAllPart.DateCreated = DateTime.Now;                newAllPart.UserCreated = userCreated;                newAllPart.Package.PackageName = partPackage;    

iterate till to get n-th level of foreign key inforamtion.

Hi.. how can i fetch n-th level of all foreign key's information? for example: one table is 'A', second table name is 'B', third tables is 'C' and so on table 'A' has a primary key, table 'B' has foreign key against table 'A' and table 'C' has foreign key of table 'B' and so on.. i want to make a such dynamic script which can get all/n-th level of foreign key relation inofrmations against. i made below script which can get foreign key information dynamically but it is used for single level not for n-th level. ALTER PROC [dbo].[sp_sng_fetching_foreign_key_info] @p_table_name varchar(100) , @flag bit AS DECLARE @pk_table_nme VARCHAR(150) DECLARE @fk_table_nme VARCHAR(150) DECLARE @pk_col_nme VARCHAR(150) DECLARE @fk_col_nme VARCHAR(150) DECLARE @constraint_nme VARCHAR(150) DECLARE @flg bit BEGIN set @flg = @flag DECLARE GETTING_ALL_FOREIGN_KEY_DATA CURSOR FOR select ISNULL(c.constraint_name,''), ISNULL(cfk.table_name ,''), ISNULL(kcu.column_name ,''), ISNULL(cpk.table_name ,''), ISNULL(pkt.column_name ,'') from information_schema.REFERENTIAL_CONSTRAINTS c INNER JOIN information_schema.TABLE_CONSTRAINTS cpk on c.unique_constraint_name = cpk.constraint_name INNER JOIN information_schema.TABLE_CONSTRAINTS cfk on c.constraint_name = cfk.constraint_name INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu ON c.constrai

for foreign key which data type is covinent ?

for foreign key which data type is covinent ?example:- a fruits shop application.i have 4 text boxes in that can enter 1.mango,2.apple,3.banan,4.pineapple.i want to buy and sale, inventry based on date save in database and retrive.can explain any one for that i think foreign key is required.so i am asking is it possible date time for foreign key ?
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