Home > 2010 Winter BTI420 > Getting started with a digital content table

Getting started with a digital content table


Now that you’re comfortable with a data access layer (i.e. a dataset), we will create a new data access layer for our programming assignment, and get started with a digital content table.

 

There are four examples today. To make use of today’s example, you must first create a database table to hold your "digital content".

Then, you must create a new data access layer (i.e. a dataset). Name it "myAssignment". Then, you can add a table adapter for the database table you just added above. As you build your own versions of the example pages, you will add more table adapters and methods.

 

A note about SQL Server data types

We intend to store digital content, which is typically byte-oriented binary data, in a SQL Server database table. What data type must we use for the column? varbinary(MAX)

The following note is from the SQL Server 2008 Books Online (November 2009):

ntext, text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.

 

Our first job – enable upload

Our first example today simply enables us to upload digital content (e.g. images and so on) to our new database table.

 

Create a digital content handler

This task is IMPORTANT. We will be creating a web form, which will return a digital content item. The item is requested with an "item ID", using a query string. The web form will then request the item through the data access layer, and return it to the caller. The return type will be the item’s MIMEType.

We’ll use the technique first covered in Week 4, in the "FileDownload" example.

 

A viewer page with a DetailsView

Now, we’ll use the "digital content handler" page we just created above.

We’ll create a page with a DetailsView on it. The DetailsView will enable us to page through the table, and display details about each item.

As an added bonus, you’ll begin to learn how to customize a DetailsView, so that it displays the images that we upload.

 

A viewer page with a GridView

Like the above example, this one will use the "digital content handler" page we just created above.

We’ll create a page with a GridView on it. 

As an added bonus, you’ll begin to learn how to customize a GridView, so that it displays thumbnails of the images that we upload.

 


Advertisements
Categories: 2010 Winter BTI420
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: