SQL Server :: Table Cause Cycles Or Multiple Cascade Paths?

Oct 4, 2010

i have a table that contains 3 forign keys, 2 of them from the same table when i make Delete Rule Cascade,this error message appears

'Customers' table saved successfully
'Order' table
- Unable to create relationship 'FK_Order_Customers1'.

Introducing FOREIGN KEY constraint 'FK_Order_Customers1' on table 'Order' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create constraint. See previous errors. what is solution,as i want when i delete data from master table ,all dependent (child) data automatically deleted, so i use Cascade.

View 2 Replies

Similar Messages:

ADO.NET :: Cascade Delete - Same Table - Entity Framework 4 Code First

Feb 8, 2011

I been looking but I cant find any info on this topic Anyway I got a model that looks like this.


I want to cascade delete a category with all its sub categories but I cant make that reference in the database, not with the option to cascade update or delete. It work fine with pagecontents and all the other I got its just this same table reference. In NHibernate I do the cascade setting hbm or with a better way using the fluent option. How do I go about this task now?

View 1 Replies

Web Forms :: SiteMap With Multiple Paths To Same Page?

Jul 20, 2010

I have a sitemap, and i'm using nested repeaters to display the parent and child nodes for my breadcrumbs.I have 3 pages: Home, Hub, and Search.Each of these pages can navigate to each other. In other words:

Home> Hub
Home> Search
Home> Hub > Search
Home> Search > Hub
Home > Default

The most common path would be "Home > Hub" and Home > Search > HubHowever, I can't seem to figure out how to show this on my breadcrumbs, since you can't have multiple ULR's in the Sitemap. Right now, you can only go "Home > Hub". If you go from "Search" to "Hub...it should show "Home > Search > Hub" in the breadcrumbs.

View 5 Replies

Multiple Paths In Location Element Of Web.config?

Dec 20, 2010

How to specify multiple paths in one location element in web.config:, a

<location path="Images">
<allow users="?" />

We would like to add styles and images to location, e.g. location path="images, styles". Is it possible to put multiple paths in location element (and how)?

View 2 Replies

SQL Server :: Trigger And Cascade Update?

Nov 2, 2010

If I use trigger, I do not need the table to determine cascade update?

View 3 Replies

C# - IIS URL Rewriting - Keep Relative Paths When Serving Multiple Files?

May 25, 2010

My WebApp is part CMS, and when I serve up an HTML page to the user it typically contains relative paths in a.href and img.src attributes. I currently have them accessed by urls like: ~/get-data.aspx/instance/user/page.html -- where instance indicates the particular instance for the report and "user/page.html" is a path created by an external application that generates the content. This works pretty reliably with code in the application's BeginRequest method that translates the text after ".aspx" into a query string, then uses Context.RewritePath(). So far so good, but I've just tripped over something that took me by surprise: it appears that if any of the query string ("instance/user/page.html") happens to contain a plus sign ("+") the BeginRequest method is never called, and a 404 is immediately returned to the user.

So my question is two-fold:

Am I correct in my belief that a "+" would cause the 404, and if so are there other things that could cause similar problems? Is there a way around that problem (perhaps a different method than BeginRequest)? Is there a better way to preserve relative URL paths for generated content than what I'm using? I'd rather not require site admins to install a 3rd party rewrite tool if I can help it.

View 1 Replies

DataSource Controls :: Uploading Multiple Files To File System And Saving Paths To Database With One Button Click

Jan 20, 2010

I creating a page where our clients can view advertising images and then able to download the images in different file formats. So I need the images and the different download types all saved into the same row in the database so that when I go to display them on the page when they select a picture the right download links will be there. So here where my problem comes in, I don't know how to code it so that I can insert mulitiple file paths into the database at once. The images are saved in a table called images. The downloads are saved in a table called Image Downloads.

Here is the code for the page I have it coded to submit the images to the database but not sure how to add the rest. I have got three different sql datasources for each table not sure if that's the way to go.


View 1 Replies

Page Cycles - How To Input Data To Database

Aug 23, 2010

I have a page that has a few textboxes and a dropdownlist. When a logged in user opens this page the boxes are filled with data that he has inputed before, he can change the data and update it by pushing a update button. There is also that dropdownlist which has a dynamically populated data for him to choose from.

What is the best way to make this page work. Where in the page cycles do i populate the forms and where do i input the data to the datatable.

At the moment I'm populating the data on PreRender but the dropdownlist on the preinit. I have a button event handler to do the update on the datatable. The problem is that the autopostback fucks up the data in the dropdownlist because its dynamatically populated, how would i go by fixing this ?

View 1 Replies

C# - Mapping A Filename To Paths On A Server?

Jun 28, 2010

I have a problem with my code. My code is using the fileupload control to browse for a filename when you add a filename it processes it and the code runs fine on when it lives on local host, but when I put the code on our prodution server it cannot find the filenames listed by user.

For example if I use the upload control to browse to B:MISCH IntiveRPTTOFL_3.csv and the code lives on my localhost which know what that file path means it works, but if the code is moved to a production server it may or maynot know what B:/ is or B:/ maybe mapped to something else. Even if I am browsing to a file on my C drive it will work on if the code is on the machine that the C drive is on, but it will not work if the code is on another machine because obviously that file wouldnt be on that C drive.

Private Function CSV2DataTable(ByVal filename As String) As DataTable

Using MyReader As New _
MyReader.TextFieldType = FileIO.FieldType.Delimited

What can I do in asp.net to make the filename work correctly?

Ok lets say I get the filename and save it as so

FileUploadControl.SaveAs(Server.MapPath("~/") + filename);

now I want to pass the filename to the function above for processing. Do I pass Server.MapPath("~/") + filename as the filename? Also when I am done what do I do to delete the file from the server?

View 1 Replies

SQL Server :: SUM In Multiple Queries Of Each Table

Dec 21, 2010

I want to find the sum of each tables fileld. how can do this. i tried the following.but could nt get the correct sum. "SELECT SUM(gb) FROM data20 union all SELECT SUM(gb) FROM data10 union all SELECT SUM(gb) FROM data5 union all SELECT SUM(gb) FROM data6"

View 7 Replies

SQL Server :: Searching Table With Multiple Parameters?

Sep 16, 2010

I want to query an SQL table using some Web controls to provide the parameters for filtering the records in the table. Results are displayed in a GridView.

I have a TextBox with an ID of "keyword" where the user may enter one or more keywords. I'd like to search 2 columns for instances of these keywords.

I also have a DropDownList named "category" that lists categories contained in a "category" column of the table.

I have a dataset with a TableAdapter for the table I want to search. Got it working fine with the DropDown List but not sure how to proceed with the TextBox and keywords.

What SQL query should I use? The user may not enter anything into the textbox, they may enter one word, or multiple words.

This is where I am now:

SELECT * FROM tablename WHERE category = @category AND ??

View 7 Replies

HTML - Why Does Rewrite Relative Paths For Runat=server Anchor Controls

Mar 24, 2010

I have my UserControls in a ~/Controls folder in my solution:


If specify the following:

<a id="theId" runat="server" href="./?pg=1">link text</a>

ASP.Net seems to want to rewrite the path to point to the absolute location. For example, If the control is on [URL] the link href will be rewritten to read

<a id="munged_theId" href="../../Controls/?pg=1>link text</a>

Why does Asp.Net rewrite these control paths, and is there an elegant way to fix it?

I just want the anchor control to spit out exactly what I tell it to!!! Is that so hard?


I've basically done what Kelsey suggested. I knew I could do it this way, but I don't like adding markup in my code when I want something relatively simple. At least it solves the problem:

Aspx page:

<asp:PlaceHolder ID="ph" runat="server"></asp:PlaceHolder>


var anchor = new HtmlGenericControl("a") { InnerText = "Previous" + " " + PageSize) };
anchor.Attributes["href"] = "?pg=" + (CurrentPage - 1);
anchor.Attributes["class"] = "prev button";

As you can see by the amount of code needed for what is essentially supposed to be be a simple and light-weight anchor, it's not the most optimal solution. I know I could use a Literal but I figured this was cleaner as I'm adding more than one anchor.

View 4 Replies

SQL Server :: How To Concatenate Multiple Rows Of Single Table

Mar 8, 2011

I've a table where one person teaches multiple classes. It looks like this.


Id Name Class Subject
2 Sam 12 English
2 Sam 10 Maths
2 Sam 10 English
2 Sam 8 History
2 Sam 12 Economics

Here Sam teaches Class 12 - English & Economics, Class 10 - Maths & English, Class 8 - History

I want to display the result like this -

Id Name Class Subject
2 Sam 12 English, Economics
2 Sam 10 Maths, English
2 Sam 8 History

How to concatenate multiple Rows?

View 6 Replies

Create Multiple RadioButtonLists From A Single Table In SQL Server Using C#?

Nov 11, 2010

I would like to use ASP.net, C# and SQL to display a list of games with radio buttons like below (the x is the radio). One team can be selected for each game.

game 1: x team 4 x team 2
game 2: x team 6 x team 1
game 3: x team 5 x team 3

The game list is stored in a table in an SQL database. So far, I can pull all teams into one big RadioButtonList. I cannot figure out how to create multiple RadioButtonList controls from this single table of games. Does anyone know how this can be accomplished - or reference to an example / tutorial that accomplishes something like this?

View 1 Replies

Web Forms :: How To Insert Multiple Record With Table In A Cell Into Sql Server

Mar 16, 2010

i need to call multi dropdown for products that retrieve product name from microsoft sql and get the price as the product is been selected from the dropdown for total amount for the customer.Example is for customer to buy 6 product.The client is to enter the number of product purchase and the 6 dropdown appears as he click ok button.And as the clients select the product from the dropdown the price sum up together before saving into database.

View 1 Replies

SQL Server :: Multiple Users Inserting Values In The Same Table At Same Time?

Dec 15, 2010

I have one SP in sql server which takes the data from user and inserts into three tables. My problem is if multiple users call the same SP in same time it throwing error..(I guess one user at a time can access the table and table will be locked, that is why remaning users getting error)how to handle this situation. it is a web application, so at a time so many people can call the same SP.How can many users insert data in the same table in the same time?

View 5 Replies

C# - Unable To Create A Multiple Row Table From Server Side Code?

Feb 22, 2010

I am trying to create a table dynamically in my code behind. My problem is I have a count of how many controls I want added to each TableRow after which I want to add that TableRow to the table and then start a new row. Here is the code I have no far but it just adds one row and does not move any of the controls to a seperate new row.

public void FillTable(string DB, int? appID, string function, int? rID, string UserId, int ControlsperRow)
OneEvaDataContext datacontext = new OneEvaDataContext();
var results = datacontext.sp_Build_Menu_Field_Names(DB, appID, function, rID);
int controlCount = 0;


I would have thought that doing the .Add only when I am finished building that row would work but I guess since I'm using the same TableRow "tr" It is only putting in just one row.

EDIT: in the is context base is my class which looks like this:

public class Dynamic_Search_Table : System.Web.UI.WebControls.Table

View 1 Replies

Web Forms :: How To Give Multiple Inner Joins To Single Table In SQL Server

Oct 30, 2012

how to give a multiple inner joins to the single table

View 1 Replies

How To Move Stored Procedure From SQL Server 2000 To 2005, Multiple Table Insert

Jul 21, 2010

moving some tables & stored procedures from SQL Server 2000, to SQL Server 2005.So far so good, but I've come across a problem with this stored procedure:

CREATE PROCEDURE [dbo].[user_insert]
@user_service_unit int,
@user_champion_1 varchar(50),
@user_champion_1_nt varchar(10),
@user_champion_2 varchar(50),
@user_champion_2_nt varchar(10),
@user_champion_3 varchar(50),
@user_champion_3_nt varchar(10),
@user_date_received datetime,
@user_requestor varchar(255),
@user_info_requested text,
@user_expiry_date datetime,
@user_10_days datetime,
@user_5_days datetime,
@user_2_days datetime

View 3 Replies

C# - Selecting Multiple Table Values And Binding The Data Into Multiple Grids?

Oct 5, 2010

i have multiple tables .

I have created one stored procedure where I am selecting the table values.



I am using LINQ to retrieve the Data. So Using Linq I am calling the stored procedure.

So I ll get the table values in the C# Code the table values.

so in my UI i have 4 gridviews.

I want split the output values into four source and bind it to the grid.

View 1 Replies

SQL Server :: What If Multiple Output Parameters And Input Parameters And Also Want A Select Table

Feb 16, 2011


When I want to get the output values its okay but I also want returning a table as a result data.But Datareader has no rows.is it possible if I want a returning query result and multiple output values togather ?I wrote a test above.I can get output values as sqlparameters. But Datareader attached to a Gridview is empty.can you detect whats wrong here and it doesnt return a query result.So stored procedure is not standart or ı am doing something wrong.this doesnt raise any exception.but not returning any data.


View 8 Replies

Forms Data Controls :: Updating Multiple Table / Multiple Row?

Feb 21, 2011

I've scenerio where i've two dropdownlist box (one dependent on other, displays handset brand name and on selection displays the respective model name), two combolistbox which is bounded to their respective datasource(Displays the fault and accessories).

Now i've to update the three tables booking(Handsetid, Brand,model), accessories(handsetId,AcesoriesID) and fault(handsetID,faultID). Ive to update multiple rows in Accessories and fault.

These controls are present in datagridview EditTemplate

View 4 Replies

AJAX :: Cascade Dropdowns With Web Methods?

May 10, 2010

I am showing state,city, zipcode in cascaded format. I designed cascade dropdown with asp dropdown list controls. I am loaing the citys & zipcode based on selection index changed.. here when I am selecting city the request is sending to server & its loading citys....

I don't want see post back operation on my page when I am selecting city & zipcode. So I am thinking to use Ajax cascade dropdown list to avoid sending the request for each selection.

If I use Ajax Cascade dropdownlist can i cascade the loading of citys & zipcode without using webservices?

If I use only webmethods for cascade dropdown it will work ?

View 4 Replies

SQL Server :: To Pass A Table Type Variable To A Table-Valued UDF In SQL Server 2005?

Nov 25, 2010

I need to pass a table type parameter to a user-defined table valued function in SQL Server 2005.How would I do this?

My function name is udf_t_GetSales ( @financialYearMonthsData as table)

The table @financialYearMonthsData has 3 columns ( MonthId int, DisplayText nvarchar(500), CalendarYear int)

View 7 Replies

Fluent NHibernate Cascade - Trying To Insert NULL ID?

Mar 8, 2011

I have the following models & mappings (code snippets further below).

One Competition has to have multiple CompetitionAnswers associated with it (multiple choice) from the outset.

At present, using the Fluent NHibernate mappings shown below, when I create a brand new Competition object, populate the properties, then create 3 brand new CompetitionAnswer objects and add them to the CompetitionAnswers property (property on Competition), I would expect to call Save on the session which would INSERT the 1 Competition row and 3 CompetitionAnswer rows to the DB.

However, as soon as I try to call Save on the session, it complains that CompetitionId is null and it can't insert a null into the CompetitionAnswers table for that field - which is right, it shouldn't, however, I assumed that the NHibernate would first create the Competition, then use the newly generated IDENTITY value (CompetitionId) in the CompetitionAnswers table?


View 3 Replies

Copyrights 2005-15 www.BigResource.com, All rights reserved