M
manmit.walia
Hello Fellow Developers,
I am very new to SQL and ASP.net and in the learning process. I have to
do a small web application that handles documents stored on a sql
database. The requirements of the functionality of the application are
below. I am just having trouble setting my query to work correctly.
Problem:
I want to be able to pull documents and folders that have the same
ClientID. However, here is the catch, the query should take two inputs
- ClientID and ParentID (which is an ID representing FolderID from the
Folder Table; the document/folder does not belong to another folder
then the system will enter ZERO as the ParentID). I hope this is
clear???
Any help is greatly appreciated, as life is a learning experience.
Database Structure:
Table Name: Client
Fields:
ClientID primary key autonumber
Name nvarchar 255
Table Name: ClientDocs
Fields:
DocID primary key autonumber
Document image (the actually file in bytes)
FriendlyName nvarchar 255
ClientID foreign key -> [Table Client]
ClientFolderID foreign key -> [Table ClientFolders]
Table Name: Folders
Fields:
FolderID primarykey autonumber
FolderName nvarchar 255
Table Name: ClientFolder
Fields:
ClientFolderID primarykey autonumber
FolderID foreign key -> [Table Folders]
ParentID int
ClientID foreign key -> [Table Clients]
I am very new to SQL and ASP.net and in the learning process. I have to
do a small web application that handles documents stored on a sql
database. The requirements of the functionality of the application are
below. I am just having trouble setting my query to work correctly.
Problem:
I want to be able to pull documents and folders that have the same
ClientID. However, here is the catch, the query should take two inputs
- ClientID and ParentID (which is an ID representing FolderID from the
Folder Table; the document/folder does not belong to another folder
then the system will enter ZERO as the ParentID). I hope this is
clear???
Any help is greatly appreciated, as life is a learning experience.
Database Structure:
Table Name: Client
Fields:
ClientID primary key autonumber
Name nvarchar 255
Table Name: ClientDocs
Fields:
DocID primary key autonumber
Document image (the actually file in bytes)
FriendlyName nvarchar 255
ClientID foreign key -> [Table Client]
ClientFolderID foreign key -> [Table ClientFolders]
Table Name: Folders
Fields:
FolderID primarykey autonumber
FolderName nvarchar 255
Table Name: ClientFolder
Fields:
ClientFolderID primarykey autonumber
FolderID foreign key -> [Table Folders]
ParentID int
ClientID foreign key -> [Table Clients]