View Complete Post
I have the following FK on Items table
ALTER TABLE [dbo].[items] WITH NOCHECK ADD CONSTRAINT [FK_items_i_tmpnam] FOREIGN KEY([i_tmpnm_id])
REFERENCES [dbo].[i_tmpnam] ([tmpnam_id])
NOT FOR REPLICATION
Yet I'm able to delete all records from i_tmpnam and leave orphans in the FK field in the Items table. So, does NOCHECK disables the constraint completely?
how to generate invoice type of key ex:emp100 with unique identifier
i generated invoice type by creating function by concatenate string and unique identifier
but it can't be reference to another table
can i have any other types generating invoice type primary key and used as a reference type
I am new to tsql so please be kind if this is bad idea. I am using visual studio, thus why everything is split up.
I am writing software that allows the user to "turn on" customizable tables to use. each table is the same. so for brevity in the database i made a single table 'User'.
CREATE TABLE [dbo].[User]
U_Table int NOT NULL,
U_ID varchar(50) NOT NULL
ALTER TABLE [dbo].[User]
ADD CONSTRAINT [PK_U]
PRIMARY KEY (U_Table, U_ID)
the primary key is made up of a table id (which user-customizable table) and the record id
now i have a transaction table that holds the id's used for each user customizable table
CREATE TABLE [dbo].[Transaction]
TRAN_ID int NOT NULL,
TRAN_User_01 varchar(50) NULL,
TRAN_User_02 varchar(50) NULL,
TRAN_User_03 varchar(50) NULL,
TRAN_User_04 varchar(50) NULL
My question is, i want to add a foreign key relationshi
I currently have a number of tables in my database, which include these 2 tables:
tblOne - Uid(pk), FirstName, LastName, Email
tblTwo - HCCID(pk), Uid, Category, Description, Company, Manager
In my application I have users from tblOne logging in and creating records which are inserted into tblTwo. Thankfully this is working ok, however, my problem is with the Uid in tblTwo (fk).
When a new record is created in tblTwo, the HCCID(pk) iterates, so i have a numeric identifier for each record. However is there any way i can also keep a record of the user by recording the Uid in tblTwo based on which user creates the record?
Seeing as though this is already a pk in tblOne and I also already have a pk in tblTwo, is this possible?
Any ideas will be greatly appreciated!
I am using Dynamic Data 4 in VS2010 with EF4.
So I have noti
I'm running VS2010 with .net 4.0, and am running into issues with the .net ajax script tags mysteriously not being rendered to the browser.
So far I've reduced it to a scenario where I set the DataSourceID property of a databound control. More specifically, I've only tested it on a Gridview and a DropDownList.
This can be reproduced fairly easily on my machine by following these steps:
1. Create a new empty Web Application Project
2. Create a new Web Form
3. Add a ScriptManager inside the form
4. Add a DropDownList and a DataSource (I used an ObjectDataSource)
5. Set the DataSourceID property of the DropDownList to the ID of the DataSource. This can be done either declaratively on the .aspx page, or in the code behind in the aspx.cs page, and both produce the same results.
Here's my source code showing my set up:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ScriptResourceFAIL.Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 T
I created 2 projects in my solution:
Both projects were created in 3.5 framework and in Visual Studio 2008 Beta 2.
I added web service reference to Class library project. When it asked for namespace I typed "CurrencyProxy". Projects build ok, but when I run web app, Class library throws an error: Could not find default endpoint element that references contract 'CurrencyProxy.CurrencyServiceSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract
could be found in the client element.
I believe it has something to do with app.config in Class library project. Here is part from app.config:
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="CurrencyServiceSoap" closeTimeout=
Before you can test any software system effectively, you must understand the system under test. If the system includes the MicrosoftÃÂ® . NET Framework, understanding the system under test includes understanding its assembly and method dependencies.
MSDN Magazine March 2006
Delegates, new in Visual Basic .NET, are type-safe, object-oriented references to methods. By using delegates, you make your methods accessible to others and therefore more extensible. This article provides an introduction to delegates, their benefits, and how they are used.Here the author shows you how to declare, create, and use delegates to invoke instance and shared methods at run time, and how to implement delegates as properties. He then goes on to provide examples of how delegates are used for callback functionality and explains the relationship between delegates and events. Finally, the article provides a glimpse at how delegates are implemented in intermediate language code by the Visual Basic .NET compiler.
MSDN Magazine February 2003
I'm building a user control to display detail information on a parent record. The user control will be displayed via an Ajax Modal Popup. The user control works and is displayed when expected. The problem that I'm having is that I'm not able to pass in the primary key for the parent. The control is displayed via the _ItemCommand event of a Repeater. In the markup for the user control, I explicity set the ContactId to 0 to avoid an error when the control loads (its still underdevelopment, eventually that I'll check if the value is valid).
I was assuming that I could change the property in the _ItemCommand event, but obviously its not working.
In the Page_Load event this code successfully sets the ContactId property of the control. The _ItemCommand event appears to set the value. However when I set a test label on the user control to the Me.ContactId, its showing '0' as if it was never passed in.
UserControlContactDetail.ContactId = "1462"
test.Text = UserControlContactDetail.ContactId
Protected Sub RepeaterDirectory_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles RepeaterDirectory.ItemCommandProtected Sub RepeaterDirectory_ItemCommand(By
Hi. I need to set the Ref value as an increasing value starting with the number 2010 ... it will be a 12 digits characters.
I tried using identity but it doesn't work. Could anyone advice on how should one could insert an increment of 10 to the ref value? In case, my explaination is not clear, below is an example.
For an example:
Record 1: ref - 201000000123
Record 2: ref - 201000000133
Record 3: ref - 201000000143
Can I create 3 columns Primary key in a list using the MOSS 2010 or 2007
Actually My requirement is
I collect some information by Country,State,Dist wise Temperature
here first 2 column is Same but 3rd column is different that's I required 3 column is Primary Key
Any one help me.
Does anyone knows if CTP 4.0 supports table with no primary key. I know Entity framework does.