After
created the album we will be redirected to upload/add photo page. On this page
we will upload the image and uploaded image will be displayed below (in
gridview) to enter description and click the save button to save the changes.

Implementation:

Create
store procedure to save/insert the uploaded photo and get the id of last
inserted record

CreatePROCEDURE
Sp_InsertPhoto

(

@albumid int,

@photopath varchar(max),

@id intoutput

)

AS

BEGIN

SETNOCOUNTON;

Insertinto Tb_Photo(AlbumId,PhotoPath)values (@albumid,@photopath)

set @id =SCOPE_IDENTITY()

return @id

END

Store
procedure to get the data

CreatePROCEDURE
Sp_GetPhotoData

(

@id int

)

AS

BEGIN

SETNOCOUNTON;

Select*from dbo.Tb_Photo where photoid = @id

END

Store
procedure to update the information/description

CreatePROCEDURE
Sp_UpdatePhoto

(

@id int,

@PhotoName varchar(100)

)

AS

BEGIN

SETNOCOUNTON;

Update
Tb_Photo set PhotoName=@PhotoName
where PhotoID=@id

END

HTML Markup
of webform:

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headid="Head1"runat="server">

</head>

<body>

<formid="form1"runat="server">

<divstyle="margin-left:50px">

<table>

<tr><td><asp:ButtonID="btngallery"runat="server"Text="View
Album"

/></td><td>

<asp:ButtonID="btncreate"runat="server"Text="Create Album"

/></td></tr>

<tr><td></td><td></td></tr>

<tr><td></td><td></td></tr>

<tr><td></td><td></td></tr>

</table>

<tablestyle="margin-top:30px">

<tr><td>Upload Image
to Album :</td><td><asp:FileUploadID="FileUpload1"runat="server"/>