Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: A CRY FOR HELP - Threading , Sockets, Asynchronous headaches Pin
Danny Rodriguez15-Aug-04 21:02
Danny Rodriguez15-Aug-04 21:02 
GeneralRe: A CRY FOR HELP - Threading , Sockets, Asynchronous headaches Pin
leppie15-Aug-04 21:19
leppie15-Aug-04 21:19 
GeneralRe: A CRY FOR HELP - Threading , Sockets, Asynchronous headaches Pin
Danny Rodriguez16-Aug-04 16:09
Danny Rodriguez16-Aug-04 16:09 
GeneralWanted: MultiColumn Expandable/Collapsable TreeView/ListView Pin
Bompus15-Aug-04 15:03
Bompus15-Aug-04 15:03 
GeneralRe: Wanted: MultiColumn Expandable/Collapsable TreeView/ListView Pin
leppie15-Aug-04 19:43
leppie15-Aug-04 19:43 
GeneralRe: Wanted: MultiColumn Expandable/Collapsable TreeView/ListView Pin
yetanotherchris17-Aug-04 5:45
yetanotherchris17-Aug-04 5:45 
GeneralControl of database entry Pin
tzewei15-Aug-04 14:37
tzewei15-Aug-04 14:37 
GeneralRe: Control of database entry Pin
S Sansanwal15-Aug-04 16:47
S Sansanwal15-Aug-04 16:47 
Make sure you have your AttachmentID column in Attachment Table set as Identity(autonumber)
CREATE TABLE [dbo].[Attachment] (
[AttachmentID] [int] IDENTITY (1, 1) NOT NULL ,
[AttachmentPath] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Attachment] ADD
CONSTRAINT [PK_Attachment] PRIMARY KEY CLUSTERED
(
[AttachmentID]
) ON [PRIMARY]
GO



Change Stored Procedure as


CREATE PROCEDURE FilePath
@AttachmentPath Varchar(50)
AS
Declare @count int
Select @count = count(*) from Attachment where AttachmentPath = @AttachmentPath
if @count =0
BEGIN
INSERT INTO ATTACHMENT(AttachmentPath) VALUES(@AttachmentPath)
END
GO



Note: An easiest way would be to have AttachementPath column set as Unique. Then, stored procedure would automatic generate an error in case of duplicate data



Sanjay Sansanwal
www.sansanwal.com
Generalshowing dataset progress Pin
slundstrom15-Aug-04 13:52
slundstrom15-Aug-04 13:52 
GeneralRe: showing dataset progress Pin
Dave Kreskowiak15-Aug-04 15:49
mveDave Kreskowiak15-Aug-04 15:49 
Generalowner drawn listview Pin
yetanotherchris15-Aug-04 12:08
yetanotherchris15-Aug-04 12:08 
GeneralRe: owner drawn listview Pin
leppie15-Aug-04 19:55
leppie15-Aug-04 19:55 
GeneralRe: owner drawn listview Pin
yetanotherchris15-Aug-04 22:59
yetanotherchris15-Aug-04 22:59 
GeneralRe: owner drawn listview Pin
leppie15-Aug-04 23:16
leppie15-Aug-04 23:16 
GeneralRe: owner drawn listview Pin
yetanotherchris16-Aug-04 0:38
yetanotherchris16-Aug-04 0:38 
GeneralDelete Image File Showed in PictureBox Pin
amgad_fathy15-Aug-04 5:11
amgad_fathy15-Aug-04 5:11 
GeneralRe: Delete Image File Showed in PictureBox Pin
Stefan Troschuetz15-Aug-04 6:01
Stefan Troschuetz15-Aug-04 6:01 
Questionhow can i down the datagrid scorller? Pin
kings_115-Aug-04 3:55
kings_115-Aug-04 3:55 
AnswerRe: how can i down the datagrid scorller? Pin
partyganger15-Aug-04 16:03
partyganger15-Aug-04 16:03 
GeneralMicrosoft Chart Control 6.0 Pin
sreejith ss nair15-Aug-04 2:28
sreejith ss nair15-Aug-04 2:28 
GeneralRe: Microsoft Chart Control 6.0 Pin
leppie15-Aug-04 5:18
leppie15-Aug-04 5:18 
GeneralRe: Microsoft Chart Control 6.0 Pin
sreejith ss nair15-Aug-04 17:45
sreejith ss nair15-Aug-04 17:45 
GeneralUSER-DEFINED xml comment tags - Intellisense Pin
14-Aug-04 23:58
suss14-Aug-04 23:58 
Generaldisable all keys including Ctrl+alt+Del Pin
Obaid ur Rehman14-Aug-04 23:28
Obaid ur Rehman14-Aug-04 23:28 
GeneralRe: disable all keys including Ctrl+alt+Del Pin
Mike Dimmick15-Aug-04 9:19
Mike Dimmick15-Aug-04 9:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.