15,900,108 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Mare7 (Top 24 by date)
Mare7
27-Aug-13 23:39pm
View
Hi, I change the code a little and it works. Thank You very much.
heres my code:
Dim FilePath As String = path + tFileName
and i added it in the insert statement in my query n i got the filepath and the file name.
Thx again
Mare7
2-Aug-13 3:50am
View
thx RedDk, now i already solve the problem. thx again
Mare7
2-Aug-13 1:29am
View
really? but if i write it in the front end, it will get really messy..but u r rite..i shouldnt do it in the stored procedure..so u got example or link related?
Mare7
1-Aug-13 5:04am
View
tq very much. ill try rewrite it in my code and see the result soon. i'll reply here again and vote once i got the result. thx again..i really appreciate it^^
Mare7
1-Aug-13 4:39am
View
DB_B
CREATE TABLE [Aduan].[ComplaintFiles](
[ComplaintFileID] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[ComplaintID] [nvarchar](50) NOT NULL,
[ResponseID] [nvarchar](50) NULL,
[FileName] [varchar](100) NOT NULL,
[Description] [varchar](255) NOT NULL,
[FileExtension] [nvarchar](5) NOT NULL,
[FileType] [nvarchar](5) NOT NULL,
[Cid] [nvarchar](50) NOT NULL,
[Cdt] [datetime] NOT NULL,
CONSTRAINT [PK_ComplaintFiles] PRIMARY KEY CLUSTERED
(
[ComplaintFileID] 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
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Refer to Complaint.ComplaintID' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'ComplaintID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Refer to ComplaintResponse.ResponseID. If attachment done during Response Conversation store the ResponseID' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'ResponseID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Desciption of the file entered by user' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'Description'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'File Extension' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'FileExtension'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'C- Complainant File or A- Answer from Officer' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'FileType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Login user ID' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'Cid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Created Date. System Date(i.e. Database Server system date)' , @level0type=N'SCHEMA',@level0name=N'Aduan', @level1type=N'TABLE',@level1name=N'ComplaintFiles', @level2type=N'COLUMN',@level2name=N'Cdt'
GO
ALTER TABLE [Aduan].[ComplaintFiles] WITH CHECK ADD CONSTRAINT [FK_ComplaintFiles_Complaint] FOREIGN KEY([ComplaintID])
REFERENCES [Aduan].[Complaint] ([ComplaintID])
GO
ALTER TABLE [Aduan].[ComplaintFiles] CHECK CONSTRAINT [FK_ComplaintFiles_Complaint]
GO
ALTER TABLE [Aduan].[ComplaintFiles] WITH CHECK ADD CONSTRAINT [FK_ComplaintFiles_ComplaintResponse] FOREIGN KEY([ResponseID])
REFERENCES [Aduan].[ComplaintResponse] ([ResponseID])
GO
ALTER TABLE [Aduan].[ComplaintFiles] CHECK CONSTRAINT [FK_ComplaintFiles_ComplaintResponse]
GO
ALTER TABLE [Aduan].[ComplaintFiles] ADD CONSTRAINT [DF_ComplaintFiles_FileType] DEFAULT (N'''C"') FOR [FileType]
GO
Mare7
1-Aug-13 4:37am
View
i dont know how to upload the script here so im gonna paste it here but its gonna be long though..
DB_A
CREATE TABLE [dbo].[saoCmpntFile](
[CmpntID] [bigint] NOT NULL,
[FileName] [varchar](50) NOT NULL,
[ResponseID] [nvarchar](50) NULL,
[Description] [varchar](255) NULL,
[FileType] [varchar](1) NULL,
[FileExtension] [nvarchar](5) NULL,
[Cid] [nvarchar](50) NULL,
[Cdt] [datetime] NULL,
CONSTRAINT [PK_saoCmpntFile] PRIMARY KEY CLUSTERED
(
[CmpntID] ASC,
[FileName] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'''R'' + Max(ResponseID)+1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'saoCmpntFile', @level2type=N'COLUMN',@level2name=N'ResponseID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'C- Complainant File or A- Answer from Officer' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'saoCmpntFile', @level2type=N'COLUMN',@level2name=N'FileType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'File Extension' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'saoCmpntFile', @level2type=N'COLUMN',@level2name=N'FileExtension'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Login user ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'saoCmpntFile', @level2type=N'COLUMN',@level2name=N'Cid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Created Date. System Date(i.e. Database Server system date)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'saoCmpntFile', @level2type=N'COLUMN',@level2name=N'Cdt'
GO
ALTER TABLE [dbo].[saoCmpntFile] WITH CHECK ADD CONSTRAINT [FK_saoCmpntFile_AduanResponse] FOREIGN KEY([ResponseID])
REFERENCES [dbo].[AduanResponse] ([ResponseID])
GO
ALTER TABLE [dbo].[saoCmpntFile] CHECK CONSTRAINT [FK_saoCmpntFile_AduanResponse]
GO
ALTER TABLE [dbo].[saoCmpntFile] WITH CHECK ADD CONSTRAINT [FK_saoCmpntFile_saoCmpnt] FOREIGN KEY([CmpntID])
REFERENCES [dbo].[saoCmpnt] ([CmpntID])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[saoCmpntFile] CHECK CONSTRAINT [FK_saoCmpntFile_saoCmpnt]
GO
ALTER TABLE [dbo].[saoCmpntFile] ADD CONSTRAINT [DF__saoCmpntF__FileT__7C055DC1] DEFAULT ('C') FOR [FileType]
GO
Mare7
1-Aug-13 4:30am
View
owh sorry2..i thought its my stored procedure script. i didnt read it properly..my bad. wait ill add it in a moment
Mare7
1-Aug-13 4:19am
View
owh you mean the script. is it really needed coz basically only what i upload is related to the problem. the thing is the script consists of many2 other query but since this project is confidential, this will be all that i can show..so sorry..
Mare7
1-Aug-13 4:00am
View
i'm sorry but what do you mean by the definitions?
Mare7
1-Aug-13 4:00am
View
PK for the table in DB_A is none only got unique file name
PK for the table in DB_B is Complaint File ID (which i insert the value @MaxFile)
Mare7
1-Aug-13 3:36am
View
i would really appreciate that. it would really helps me.
Mare7
1-Aug-13 3:35am
View
Hi, i already updated my question with my table structure
Mare7
1-Aug-13 0:24am
View
i'm sorry but i always have problem understanding anything from that same website..huhu. can you explain it to me or give me another link related please..
Mare7
19-Jul-13 5:18am
View
Owh..juz need to change the position only. Tq for responding to my question..i appreciate it a lot. thx again
Mare7
19-Jul-13 5:16am
View
Of Course. Thx again..
Mare7
19-Jul-13 5:01am
View
Hi,thx chicam. i change it a little and it works great. thx a lot.
here is what i do --> SELECT @CmpntID = CAST(CmpntID AS VARCHAR)
Mare7
19-Jul-13 3:45am
View
I write ur solution in my stored procedure. however the line turns to error which said "A select statement that assigns a value to a variable must not be combined with data retrieval operations. and when i execute it, its throwing an error such as Incorrect syntax near '='.
Mare7
19-Jul-13 3:01am
View
owh ok..sorry2..its my mistake. i put the code before i declare the filename. now it works already. thanks a lot. ur da best!!
Mare7
19-Jul-13 2:58am
View
thanks you very much. i think this code would work already only when i rewrite it in my code, the ".GetExtension" will be detected as undeclared element. do i need to declare anything else?
Mare7
19-Jul-13 2:39am
View
thank you for your response. but can u please explain it to me how to implement this in my code?
my insert statement goes like this
("Insert Into saoCmpntFile (CmpntID, FileName, Description,FileType, FileExtension, cid, cdt) Values([/" & txtID.Value & "/],[/" & NewFile & "/],[/" & txtFileDesc.Text & "/],[/C/], "THIS IS WHERE I SHOULD PUT THE VALUE OF FILE EXTENSION" [/" & User.Identity.Name & "/], GetDate())")
how do i do the declaration or such to get the value?
THANK YOU IN ADVANCE..
Mare7
19-Jul-13 0:09am
View
i dont think that the answer though..n thats in php..
Mare7
19-Jul-13 0:06am
View
owh sorry. i wanna add the extension like .pdf or .docx ...
Mare7
18-Jul-13 22:44pm
View
well i don't know why though. my boss said its for auditing purpose later. i'm juz following orders. but since i'm still a beginner..i don't know how to do it.
My table is about the file uploaded. got the fileID, fileName, FileExtension and user id. i manage to insert all the data to all the field except the file extension field.
Mare7
18-Jul-13 22:33pm
View
i already upload the file. but i need to insert into another field the extension of the file like .docx or .pdf..
Show More