In grid view in more than one table values should bind in GridView1..
1.fileInfo
CREATE TABLE [dbo].[fileInfo](
[fileId] [bigint] IDENTITY(1,1) NOT NULL,
[userId] [bigint] NULL,
[fileName] [nvarchar](50) NOT NULL,
[fileType] [nvarchar](50) NOT NULL,
[fileSize] [nvarchar](100) NOT NULL,
[filePath] [nvarchar](200) NOT NULL,
[createdOn] [datetime] NULL,
[statusId] [bigint] NULL,
[lastModifiedOn] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[fileId] 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
2.status
CREATE TABLE [dbo].[status](
[statusId] [bigint] IDENTITY(1,1) NOT NULL,
[statusName] [nvarchar](30) NOT NULL,
[statusColor] [nvarchar](10) NOT NULL,
[active] [bit] NULL,
[createdOn] [datetime] NULL,
[modifiedOn] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[statusId] 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
3.userInfo
CREATE TABLE [dbo].[userInfo](
[userId] [bigint] IDENTITY(1,1) NOT NULL,
[email] [nvarchar](30) NOT NULL,
[password] [nvarchar](20) NOT NULL,
[firstName] [nvarchar](50) NULL,
[lastName] [nvarchar](50) NULL,
[activationKey] [nvarchar](800) NULL,
[active] [bit] NULL,
[createdOn] [datetime] NULL,
[modifiedOn] [datetime] NULL,
PRIMARY KEY CLUSTERED
(
[userId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED
(
[email] 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
i want to display: fileName, FileType, fileSize, filePath, CreatedOn from
fileInfo
Table and statusname from
status
Table
I try it like this
select fileName, fileType, fileSize, filepath,createdOn,statusName from status inner join fileInfo where userId=(select userId from userInfo where email)
please say correct solution Friends!
Advance Thanks Friends!