Request Web Database Tutorial - Simple Examples

C

Chris

Greetings,

To clear the air, I am a hardware guy and not a software guy by nature.
However, need to learn some basics quickly.

We have a Sql Express 2008 DB that houses some scanned data.

Using Sharepoint Designer, was able to whip up a quick DataGrid thing and
view the data - just don't like the limitation I have.

The table elements are below:

SELECT [StockID]
,[PalletBarcode]
,[BoxBarcode]
,[StockCode]
,[OrderNumber]
,[StatusID]
,[StatusDate]
,[RevisionStamp]
FROM [DataWhse].[dbo].[Stock]
WHERE BoxBarcode LIKE 'value%'


What I would like to try to learn how to do is:

Main Querey is display top 10 records for todays date.

Give an Input Box and Button to search for a Boxcode and display records
associated.

Also search for a PalletCode, Group and show all boxes on the pallet.

I think I can figure out the SQL for it, just get confused on how to code it.

If someone can give some examples - or better yet point me in the best
direction of resources - keeping my frame of reference. MSDN showing
libraries probably not the best location for newbies.
 
G

Gregory A. Beamer

If someone can give some examples - or better yet point me in the best
direction of resources - keeping my frame of reference. MSDN showing
libraries probably not the best location for newbies.

First, understand how to drag and drop controls on the page to query a
database:
http://bit.ly/SW4O

This is in SharePoint Designer. You can also look at earlier Expression
tutorials at http://www.microsoft.com/expression/, as the two tools are
the same. Here is a video on the DataSource for example:

http://expression.microsoft.com/en-us/cc265108.aspx


Now some specifics:
Main Querey is display top 10 records for todays date.

SELECT TOP 10 *
FROM Table
ORDER BY TableDate DESC

You should iterate the fields rather than use the *, but that is the
basics.
Give an Input Box and Button to search for a Boxcode and display
records associated.

This is done by setting up a DataSource control (SqlDataSource for SQL
Server) and linking the input of the query to the DataSource. I used to
have a link for an example for this. NOTE: if this is on the same page
as the last example, you will have to use a second DataSource, as the
control is mapped both to the results grid and the textbox.

Also search for a PalletCode, Group and show all boxes on the pallet.

Same basic idea, but you will end up with a bit of code to link
everything together.
I think I can figure out the SQL for it, just get confused on how to
code it.

Solve problem 1 first, which is learning the DataSource control. You may
outgrow it, but it is a good start.

I would also look at ASP.NET sites for data binding, as there are some
great tutorials out there. This is a great starting place:

http://www.asp.net/learn/

Peace and Grace,


--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top