Tuesday, July 10, 2007

Create ASP.NET WebService Project WebServiceDemo

  1. Draw a .NET flow chart / diagram showing the relationship between
    1. The program languages that come with VS.NET
    2. The .NET Class Libraries
    3. The CLR
    4. MSIL
    5. JIT
    B. On that diagram explain what each part does
  2. Create a new Project Called Assignment01
    A. Create a new WebForm called HelloWorld
    B. Screen print document property page changing to flow layout.
    C. Place a button (btnHello) and a label on the form
    D. When you click on the button the label displays “Hello World on (today’s date)”
    1. Date.Now.ToString("d")
    2. Find two additional formats for the date/time.
    E. Screen print code
    F. Screen print running results
  3. Screen print: Set the IDE as follows
    A. Toolbox and Solution Explorer to Autohide (pin side) with tabs
    B. Properties to Autohide (pin down) off
    C. Code behind with intellisense for Page.
    D. HTML view
  4. Create a new WebForm called Data (tip use the book to help with this)
    A. Use SqlDataAdapter, Dataset and GetXML
    B. Fill a textbox with XML with ProductID, ProductName from Products in Northwind database
    C. Tips: Textmode = multiline

    Dim ds As System.Data.DataSet
    Dim da As System.Data.SqlClient.SqlDataAdapter
    Dim strCon As String = "Server=surf7\VSdotNet;Database=Northwind;uid=sa;pwd=password"

    Dim strSQL As String = "Select ProductID, ProductName from Products"

    da = New System.Data.SqlClient.SqlDataAdapter(strSQL, strCon)
    ds = New System.Data.DataSet()
    da.Fill(ds)

    txtXML.Text = ds.GetXml
  5. Create a new WebService Project called WebServiceDemo
    A. Create a .asmx page called Service1
    B. Expose a WebMethod Function called Hello that accepts one parameter called Name
    1. Public Function Hello(ByVal Name As String) As String
    C. It will return the string Hello ‘name’ where name is the value that is passed.
    D. Screen print Code
    E. Screen print the results from the browser test.