|
Well the insert statement excludes this key, because I assumed , that the behavior would be similar to that as when I update the table manually, for example:
"INSERT INTO [teamwiki].[dbo].[task]\r
([category_FK1]\r
,[sub_category_FK2]\r
,[ideal_delivery_date]\r
,[latest_delivery_date]\r
,[task_deadline]\r
,[request_date]\r
,[requesting_user]\r
,[assigned_to]\r
,[managed_by]\r
,[implementor_notes]\r
,[attachment] \r
,[last_update]\r
,[in_use])\r
VALUES (@category, \r
@sub_category,\r
@task_description,\r
@priority,\r
@status, \r
@ideal_delivery_date,\r
@latest_delivery_date,\r
NULL,\r
GETDATE(),\r
@requesting_user,\r
NULL,\r
NULL,\r
NULL,\r
NULL,\r
@in_use,\r
@product)" string
In my case, the primary key is named taskID_PK, as previously posted.
2. When I update data manually (e.g. through SQL Management Studio > right click on the table > Open table), the key is automatically incremented.
3. I created the table with an identity trigger simply using SQL Management Studio:
3.1 Taking a copy of the CREATE TABLE. Right click on table name > Script Table As > CREATE TO > New Query Window.
3.2 Dropping the table. Right click on the table name > delete.
3.3 Altering the CREATE TABLE statement to include identity:
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[task](
[taskID] [numeric] (2, 0) identity NOT NULL,
[task_description] [nvarchar](50) NULL,
[date_entered] [datetime] NULL,
[productID_FK1] [numeric](2, 0) NULL,
CONSTRAINT [PK_task_1] PRIMARY KEY CLUSTERED
(
[taskID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[task] WITH CHECK ADD CONSTRAINT [FK_task_product] FOREIGN KEY([productID_FK1])
REFERENCES [dbo].[product] ([productID])
GO
ALTER TABLE [dbo].[task] CHECK CONSTRAINT [FK_task_product]
Attempted solutions
-------------------
Since the key is a primary key, it doesn't accept any NULL values; it was recommended to use identity columns as opposed to a trigger that alters the table upon insert, because "it would be a computational suicide".
Related links
--------------
Forum post[^]
Jon
|
|
|
|
|
Hmmm, sounds difficult. Maybe you have to activate the Identity_Insert property explicit. Run this query before you insert a line:
SET IDENTITY_INSERT taskID_PK OFF
Could you provide a snippt of the code, executing the command?
Regards
Sebastian
|
|
|
|
|
I have created a windows control project. The control contains a datagridview. Now I'm trying to get it to work on an asp .net page. I have put the following code in the page:
<object id="myControl1" name="myControl1" classid="MyClientControl.dll#MyClientControl.AuthorsControl" style="width: 505px; height: 145px></object><br mode=" hold=" /><br mode=">
|
|
|
|
|
You know this means your users need .NET installed and need to fully trust your site over IE's warnings, right ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hi
Error updating JScript IntelliSense: Client-side script IntelliSense information was not generated due to an error in an external script reference.
How can I fix it ?
I follow this step from :
- Step 1: Install VS 2008 SP1
VS 2008 SP1 adds richer JavaScript intellisense support to Visual Studio, and adds code completion support for a broad range of JavaScript libraries.
You can download VS 2008 SP1 and Visual Web Developer 2008 Express SP1 here.
- Step 2: Install VS 2008 Patch KB958502 to Support "-vsdoc.js" Intellisense Files
But nothing still receive this error in visual studio.
Please help
Thanks
|
|
|
|
|
how to fetch stock market values in asp.net application,is there any script available,please let me know
hi this is rakesh
|
|
|
|
|
First of all you have to find a service that will give you this information. They will tell you how to retrieve the information in the format that they deliver it in (probably some XML structure these days)
|
|
|
|
|
Wow - do you have any idea what ASP.NET is, and does ? I doubt it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hi,
I cannot find a visual studio forums section in this site and so i have posted my question here..
When i try to build my Business Logic Module Of My Applicatio, It takes a long time to build for a very small change.. say(if i change int i to int j), it takes nearly 10 mins to build the BL module alone..
What could be the reason behind it ..
Thanks in advance.. and Sorry for the inconvenience for posting this qn in ASP.NET forum..
|
|
|
|
|
jchandramouli wrote: I cannot find a visual studio forums section in this site
Here[^].
jchandramouli wrote: When i try to build my Business Logic Module Of My Applicatio, It takes a long time to build for a very small change.
How many projects are there in solution?
|
|
|
|
|
I imagine that lots of things depend on your business logic "module" and so when you change that all the dependencies have to ensure they still compile against the new "module".
|
|
|
|
|
|
I have a treeview control which mostly displays pdf's. Currently when i left click on the pdf it goes to new page and opens the pdf. How can i have the pdf open in same window and be able to see both the treeview and the pdf on the same screen
|
|
|
|
|
Split your page with HTML frames.
|
|
|
|
|
Is there a better way for VS 2005? or is this the only way?
and how to tell it to open the pdf in the other frame?
|
|
|
|
|
Civic06 wrote: Is there a better way for VS 2005?
VS2005 is an IDE and how it can control where PDF is opened?
Civic06 wrote: and how to tell it to open the pdf in the other frame?
By setting the target[^] attribute to the hyperlink.
|
|
|
|
|
I guess, WebParts[^] may be a good solution for this scenerio,
|
|
|
|
|
Hi,I think you can use two different panels for treeview control and pdf content.According to your requirement you can make those panels set to visible or not.Hopefully this would be the easiest and fast solution for the kind of pdf's you are using.
Lets you make a try on this.
GoodLuck.
|
|
|
|
|
Hi,
I want to generate barcode of a string and want to read it back using barcode reader.
i want the size of barcode to be less then 2.5 * 2 centimeters.
i want to implement this in my .net application.
can anyone give me the solution??
is there any free control for doing the same??
Thanks a lot....
|
|
|
|
|
|
Hi,
I want to design my Website. I want to use Silverlight control.
Which silverlight controls are available. How can I use.
Or Is there any other readymade templates avaialable.
Thanks
|
|
|
|
|
|
Hi friends
I have created a user control with name menuUserControl with menu control in it. I have created a user defined property for the user control(menuUserControl) as groupid and when ever I pass groupid to the user control(menuUserControl) in a page, it should use a theme based on the groupid I pass to it.
For example if I use two user controls(menuUserControl) one at the top and other at the bottom of the the page with two different groupids like if I pass groupid=1 for top user controls(menuUserControl), it should use theme1 and groupid=2 to the bottom user controls(menuUserControl), it should use theme2.
So my problem is that I am unable to apply theme to the user control. I have done some google search but unable to create a theme for a user control. I am only able to apply themes to the server controls. As I am using two user controls i.e menuUserControl as said above, both are displaying same theme. I want to apply two different themes to two user controls(menuUserControl). If any one have any solution or any other alternative, kindly help me please, Its very urgent for me.
If you did not understand or you have any doubt, please reply back, I will try to analyze the problem. Hope to get a positive response.
Thanks
Wajid
|
|
|
|