Wednesday, May 07, 2008

To leverage the DatePicker control just drag it on the form. Then in the form load function determine the format (e.g., DateTimePicker1.Format = DateTimePickerFormat.Short ). The selected date is then available in the Text property of the control (and should show up on the form). By default today's date should be shown.

The key properties for the calendar are

SelectionStart - This is the first selected date (it is possible to select multiple dates at a time!)

TodayDate - This sets today's date (which otherwise is set automatically by the system clock!)

Enumerations are commonly used for small sets of finite values (i.e., types or status). It is easy to work with Enums in the .NET framework, the .NET compact framework, however, has some limitations. The example below is for an Enum called PersonStatus (with the values Here, There, Somewhere)

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' In the .NET framework this would work
        '    Me.ComboBox1.DataSource = [Enum].GetNames(GetType(PersonStatus))
        ' Unfortunately this does not work in the .NET Compact Framework
        ' So some hardcoding needs to be done ...
        Me.ComboBox1.Items.Add("Here")
        Me.ComboBox1.Items.Add("There")
        Me.ComboBox1.Items.Add("Somewhere")
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Select Case Me.ComboBox1.SelectedItem
            Case "Here"
                thisPerson.Status = PersonStatus.Here
            Case "There"
                thisPerson.Status = PersonStatus.There
            Case "Somewhere"
                thisPerson.Status = PersonStatus.Somewhere
            Case Else
                'do nothing
        End Select
    End Sub


Powered by Zoundry

5/7/2008 2:04:45 PM (Central Standard Time, UTC-06:00)
 Monday, May 05, 2008
If your project is leveraging a Web service and you need more data to start out with, here is what you can do:

1) Write code in your device application that calls the addX (X is your thing ... restaurant, task, etc.) of your Web service. Make sure you provide unique IDs!

2) Create a network location (see previous blog) and work directly in the XML. Open your XML file in Visual Studio. Can be a quick way, but also error prone, which may lead to problems in the deserialization of your XML data. Use copy/paste as much as possible.

3) Modify the generateData method in your Web service. Right now it only creates one test item. Simply repeat as much as you like the code that creates the data item, assigns the values, and adds it to the array list. Make sure you provide unique IDs!
        Dim al As New ArrayList()
        Dim da As DataItem()
        Dim di As DataItem

        Try
            'test item (your item may have other attributes!)
            di = New DataItem
            di.ID = "0000" 'provide unique ids
            di.Name = "test"
            di.Value = 1.0
            al.Add(di)

            'another item
            di = New DataItem
            di.ID = "0001"
            di.Name = "test again"
            di.Value = 1.0
            al.Add(di)

            '... and so on

            da = al.ToArray(GetType(DataItem))

            Return DataManagementSystem.saveDataItems(da)
        Catch ex As Exception
            Return ex.Message
        End Try



I would use 3 to get started (and reset if necessary) and then work using 2.

MH

5/5/2008 12:07:06 PM (Central Standard Time, UTC-06:00)
 Saturday, May 03, 2008

I have created - for everyone who has sent me a class and a Web service URL - a web service that can be leveraged by the mobile device application for the project.

Some examples are

John's pricing service

Tom's Restaurant service

All the services provide basic CRUD functionality for each class ... create, read, update, delete ... and are based on my DataManagementService. John, for example, has three classes, thus he has quite a few more functions in his service than Tom. Depending on their business logic not all of the methods may be used.

It is important to note that every class has an ID property with which an object can be identified.

Creating all the "different" Web services, was quite easy. In Tom's case I just had to find "DataItem" in my code and replace it with "Restaurant" ...

If you want to see the code behind this take a look at the DataManagementService project in the code folder on the G-drive.

The data.xml files are stored at ../fpdb/data.xml . That means in the fpdb folder right below your personal folder on the Web server, as this folder has the needed write permissions. In case you do want to view your data.xml you need to setup a "network location" to your fpdb folder (in my case http://www.746.sba.uwm.edu/mhaines/fpdb) (see FAQ for instructions).

MH

Note: The generateDataFile method is used to create a data file if none exist. However, I did create one already for each Web service. If the generateDataFile method is used all existing data will be lost!

Technorati : ,

Powered by Zoundry

5/3/2008 5:04:43 AM (Central Standard Time, UTC-06:00)
 Wednesday, April 30, 2008

For anyone you needs to do some direct XML processing (i.e., RSS feeds) take a look at the following past blog entry and other resources:

Blog post about Google Calendar feed

Slides with XML processing code

... or just use this RSS Feed Web service :-) (Just plug-in the RSS URL, it returns an RssFeed object with its "news" items. The application key is "rss".)

MH


Technorati : , ,

4/30/2008 3:34:07 PM (Central Standard Time, UTC-06:00)

Vista users: In case you are getting stuck again with getting your device emulator to connect to the Internet after cradling it: Don't miss the last step in the Mobile Device Center!

In the Mobile Device Center, you should see the green check mark and "connected". However, that is not enough. Make sure you click on "connect with out setting up your device". Only after this step you can connect to the network (and the Internet). Check it out by running Internet Explorer in the device emulator.

If you can pull up a Web page you are good to go!

MH


Technorati : ,

4/30/2008 3:29:12 PM (Central Standard Time, UTC-06:00)
 Thursday, April 17, 2008

As you may have noted, lab #4 and assignment #4 are very similar. In fact, if you have completed the optional part of lab #4, you have essentially solved assignment #4.

Here is where the solution to assignment #4 may differ slightly from the lab. In the lab the patient information is loaded into the listboxes right upon loading the form. In your assignment you should have a load and a save menu option. The data can be loaded from the Web service or from the local file. This means you may provide two load menu options (load local and load remote) ... or you could write code that tries to always load the remote file via the Web service and when this is not possible tries the local file. The quick and dirty solution would be a a try-catch statement. Just let the remote attempt fail and load the local file in the catch part. The smarter solution is to determine with some code whether the device is connected .

In any case you will need to think about where the code that loads the data from the Web service has to go now, as this may be different from lab#4. There could be also some opportunity (not required) for refactoring!

A note regarding using XML. As it became apparent in the demo provided in the last class session, you may need to add the System.Xml reference to your project references. Go to MyProject, the Reference tab, and view the existing references. If it is not listed, click on Add Reference and select System.Xml from the list in the dialog box. Then add a Imports System.Xml.Serialization statement at the top of your code file.

MH

Technorati : , ,

Powered by Zoundry

4/17/2008 6:31:21 PM (Central Standard Time, UTC-06:00)
 Tuesday, April 01, 2008
You can connect the emulator directly to the network without involving ActiveSync.
... and that's no April fools day joke.

So, there are two ways to connect to the network
1) simply cradle the emulator and connect via ActiveSync to the network,
2) use the VPC network driver to directly connect to the network (no ActiveSync involved).

If you want to achieve the latter, the first step is to see whether you have the VPC driver installed. Start the emulator and choose File->Configure ... from the top menu.
In the configuration dialog window, choose the Network tab. Check the "Enable ... network adapter" box. If you do not have the VPC, you will get a message at this point. If you are able to check the box, you have the VPC driver already.

If you do not have the VPC driver, go download and install it. Then try to check the network adapter  box again in the configuration dialog of the emulator.

To test whether you can connect to the network with your emulator, just start the Web browser and try to connect to a Web site (i.e., google.com).
If this does not work, check the following:
In the emulator, choose "Settings" from the start menu (drop down from the top left corner).
In settings,  choose the  "Connections" tab, then click on "Network Cards". The drop down list for "My network card connects to" should show "The Internet".

MH


4/1/2008 9:57:48 AM (Central Standard Time, UTC-06:00)
 Friday, March 28, 2008

Here is an example of how to use my NOAA Weather service. The service is available (and can be tested) at http://www.531.sba.uwm.edu/mhaines/webservices/NOAAWeatherService.asmx

For this example I created a simple form with a textbox called txtSearch, a button called btnFindLocations, a combo box called cbxLocations, and a label called lblWeather.

The user can enter a search term in the txt box and the weather stations that match will be added to the list of items in the combo box. The display member of the combo box is set to "description", thus the content of the description shows for each item.

There are two event handler routine shown in the example code below. One for the user clicking on the button, the other for the user selecting an item from the list. If you create controls (textboxes etc.) on your form with the same ID as I mentioned above, all you need to do is to insert the code in the class that represents your form, and create a Web reference to the weather Web service (see URL above) called wrefWeatherService .


    Private Sub btnFindLocations_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindLocations.Click
        Dim ws As New wrefWeatherService.NOAAWeatherService 'weather service objet
        Dim locations As wrefWeatherService.WeatherStation() 'array of weather stations called locations
        
        Try
            'get the locations matching search term from Web service
            locations = ws.searchLocation(txtSearch.Text)


            'fill the combo box
            cbxLocations.DisplayMember = "Description" 'show station description
            For Each thisLocation As wrefWeatherService.WeatherStation In locations
                cbxLocations.Items.Add(thisLocation) 'add station to list
            Next

        Catch ex As Exception
            lblWeather.Text = "ERROR - btnFindLocations_Click" & ControlChars.CrLf & ex.Message
        End Try

    End Sub

    Private Sub cbxLocations_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbxLocations.SelectedIndexChanged
        Dim ws As New wrefWeatherService.NOAAWeatherService
        Dim weatherInfo As wrefWeatherService.WeatherInfo
        Dim l As wrefWeatherService.WeatherStation

        Try
            l = cbxLocations.SelectedItem
            weatherInfo = ws.getWeatherForLocation(l.StationName, l.StationRegion, l.StationCode, l.Longitude, l.Latitude)
            lblWeather.Text = weatherInfo.LocationName & ControlChars.CrLf
            lblWeather.Text += weatherInfo.TemperatureAirInFahrenheit & "F "
            lblWeather.Text += weatherInfo.TemperatureAirInCelsius & "C "
        Catch ex As Exception
            lblWeather.Text = "ERROR - cbxLocations" & ControlChars.CrLf & ex.Message
        End Try
    End Sub

  

The key steps for using a Web service are ...

  1. Create a Web reference (need URL to WSDL of service)
  2. Declare and create a Web service object (must create with New!)
  3. A variable that can receive the result of the Web service needs to be declared (simple data type of complex type defined in Web service).
  4. Call method of the Web service and receive the result
  5. Do something with the result (i.e., but the weather stations in the listbox)

Technorati : ,

3/28/2008 3:07:20 AM (Central Standard Time, UTC-06:00)
 Wednesday, March 26, 2008
 #
 

I have posted an example of a requirements document and project plan from last year's class.

Also take a look at the project milestone description on the course Web site.

MH

Technorati :

3/26/2008 2:46:57 AM (Central Standard Time, UTC-06:00)
 Monday, March 24, 2008

Ok, now you have a Web service (or you know where there is one that provides the needed functionality), how do you leverage it.

Here are the key steps:

  1. Know the URL of the WSDL for the Web service.
    The WSDL may reside on your local machine or on the Web. In case of the typical .NET Web service the WSDL can be accessed by adding a ?wsdl after the .asmx file of the Web service (i.e., http://www.531.sba.uwm.edu/mhaines/WebServices/testService.asmx?wsdl). If it is your Web service, an easy way to figure out the URL of the Web service is to run it in the browser and copy the URL from the browser.
  2. Create a Web reference.
    Right-click on your project in Visual Studio and choose 'Add Web Reference'. In the dialog window provide the URL to the WSDL (or just the .asmx file, if it is a .NET based Web service) and hit 'Go'. If the Web service and its methods show up, provide a name for the Web reference. I like to call them wref... (i.e., wrefTestService for my testService.asmx) rather than the default reverse domain name.
  3. Create a Web service object.
    Declare a variable of type WebReferenceName.ServiceName (i.e., Dim ws As New wrefTestService.TestService). The ServiceName is the name of the Web service class in the .asmx file! ... and don't forget to actually create the object with the keyword New (one of the top 10 mistakes)!
  4. Use the Web methods of the Web service.
    Example: result = ws.testMethod()
    Keep in mind that the data type of result must match the data type returned by the service. A service method may also have input parameters.

You may also peek into the lab instructions for lab #1 of the BUS ADM 746 course.

BTW, here is a list of a couple of Web services that you can check out:

Also look on the following sites for service:

You also just search for it. If you are interested in a Web service that provides stock quotes just search for "stock quote Web service".

[Note: A - not all services listed always work , B - you may need to sign up for a trial license to use a service ]

MH

Technorati : ,

Powered by Zoundry

3/24/2008 3:10:27 PM (Central Standard Time, UTC-06:00)
 Monday, March 17, 2008

All students have a folder on our Web server available in which you can create Web services (and Web pages). The base URL is http://www.746.sba.uwm.edu/ . Just add your login name to the URL and that is your personal folder on the Web server under which you can create the Web sites.

It is fairly easy to get started with setting up a Web service. The step below outline the process of setting up a Web service.

  1. Add a new Web site: right-click on your solution, then choose Add -> New Web Site.
  2. Select the Web site type: In the dialog window choose ASP.NET Web service, make sure Visual Basic is selected as the language (unless you want to do this in C#!), the location is set to HTTP and the URL for your web site (your folder URL + name of Web site, for example: http://www.746.sba.uwm.edu/mhaines/myWebServices).
  3. Provide your SBA login (e.g., SBA\mhaines)
  4. TaDaa ... there is your Web service! By default a Service.asmx (and Service.vb) is created and a HelloWorld test method. You can leverage this default service or - I would recommend - just add another Web service to the project and name it according to what it does (i.e., TrafficService.asmx).
  5. Create your Web methods. Leverage the HelloWorld function as a template to create your own. Note that a Web method must have the <WebMethod()>_ annotation above the function header!
  6. Test the Web service by right-clicking on the .asmx file and selecting run in Browser. A test page should show up and you should see your Web methods. I will place some more detailed information in the FAQ.

Again, this is something you can check, if you want to learn about creating a Web service. It's not required.

One important thing that everyone will have to figure out, however, are the data structures that you many need.

So if you deal with customer information, you need to figure out what the data elements are that pertain to the customer. In the end you will need to create a class that represents these data elements. This may look like the example below:


    Class Customer
      Public ID As String
      Public FirstName As String
      Public LastName As String
      Public Email As String
    End Class

With this you can now write functions that for instance get a list of Customer objects. For example:

'this function gets an array of Customer objects (the customer list)
Function getCustomerList() As Customer()
  'code here 
End Function

If it is a Web Service function (Web Method) then add the Web Method annotation to the function header

'this function is a Web Method that gets an array of Customer objects (the customer list)
<Web Method()> _
Function getCustomerList() As Customer()
  'code here 
End Function  

OK, you have a Web service ... now what?

See next posting on consuming a Web service from an application, including a mobile smart device application.

MH

Technorati : ,

Powered by Zoundry

3/17/2008 3:28:58 PM (Central Standard Time, UTC-06:00)

Here are a few things that may be helpful in thinking about the project and arriving at conceptual design.

Most students have project scenarios that involve getting information from a "back-end" source to the mobile device.

Thus it is necessary to have to things:

  1. some kind of back-end - even if it is just a simulated back-end, and
  2. a mechanism to get the information from that back end to the mobile device.

A relatively easy answer to implement this is "Web services". Even if you are not accessing a real back-end, you can use them to simulate a back-end ... and that is sufficient for the proof-of-concept you will develop in this class!

If you are adventurous and would like to set up a simple Web service yourself, you can do this on your own (more below), if you just want to focus on your mobile application, I can setup a simple Web service for you with 2-3 basic operations (i.e., getCustomerList, saveCustomerList). I will follow-up with another post setting up a Web service.

I have already a number of services setup, including a weather service, a traffic service, a membership service (to manage users), a lottery number service, and a MCTS bus schedule service. (Some of these service require an application key, so talk to me if you want to use them!)

MH

Technorati : ,

Powered by Zoundry

3/17/2008 3:19:01 PM (Central Standard Time, UTC-06:00)
 Monday, March 10, 2008

I finally got around to check out how to connect the Smart Device Emulator in Vista. (See the course FAQ for doing this in XP.)

The big difference is that ActiveSync is replaced with the Windows Mobile Device Center.

It turned out to be pretty straightforward in my environment and fairly similar to setting up ActiveSync in XP. I tried this on my laptop running Vista Ultimate and Visual Studio 2008 (not 2005!). Before starting the device emulator I went to the mobile device center and opened up the connection settings. The only thing I had to adjust is the "allow connections to the following" (see image).

mobileDeviceVista.png

The "allow connection to the following" option has to be checked and DMA (direct memory access) needs to be selected. Then I started up the emulator via the device emulator manager in Visual Studio (Tools->Device Emulator Manager).

I cradled the emulator and ... it connected without a hitch.

Now, if you use Visual Studio 2005, you need to download and install the new device emulator (version 2). Visit the following sites for more information.

http://blogs.msdn.com/anandba/...

http://blogs.infosupport.com/blogs/willemm/...

Let me know if you still run into issues.

MH

Technorati : , ,

3/10/2008 6:47:09 PM (Central Standard Time, UTC-06:00)
 Wednesday, March 05, 2008
 #
 

So why did the "FirstName" did not show up in the listbox? It became already clear during the demonstration that it had nothing to do with the listbox, since the combo box also did not produce the intended results either.

As I figured out shortly after the class ended, the problem was not related to the code in the event handler routine nor the form frmStart in my smartDemoApp at all. The problem lies with the Person class declaration. Since we have not covered object-oriented programming and the concept of a class, my intention was to keep the design of the class as simple as possible, thus taking a shortcut.

All the class attributes , including "FirstName", were declared as simple Public attributes (as shown below).

Public Class Person
    Public FirstName As String
    Public LastName As String
    Public SSN As String
End Class

They should really have been declared as Public Properties instead. Usually it is considered good class design to make all attributes of a class private and use the property mechanism to expose them externally. As it is evident in the complete class declaration below, this makes the whole class declaration quite a bit longer and more complex.


Public Class Person
    Private _firstName As String
    Private _lastName As String
    Private _ssn As String

    Public Property FirstName() As String
        Get
            Return _firstName
        End Get
        Set(ByVal value As String)
            _firstName = value
        End Set
    End Property

    Public Property LastName() As String
        Get
            Return _lastName
        End Get
        Set(ByVal value As String)
            _lastName = value
        End Set
    End Property

    Public Property SSN() As String
        Get
            Return _ssn
        End Get
        Set(ByVal value As String)
            _ssn = value
        End Set
    End Property

End Class


So why did I think that my shortcut (not using properties) would work in the first place?
This relates back to Web services ... which is also beyond what we have covered so far in class.

A simplified Person class without using properties would have worked, if used in the context of a Web service. It comes down to the fact that Web services are not distributed objects, and the distinction between a property and a public attribute disappears, when a class is exposed via a Web service ... everything becomes a property.

I guess I have been doing a few too many Web service projects lately ;-)

So my lessons out of this failed demonstration are:

1) Only properties will be recognized as a display or value member

2) Web services are not distributed objects (and the distinction between an attribute and a property disappears)

3) Don't take shortcuts ... I need to read the story of the turtle and the hare again!

MH

P.S.,

You can download the code relating to the this demo from the G-drive (see course folder -> code -> smartDemoApp.zip)

Technorati :

Powered by Zoundry

3/5/2008 6:33:32 AM (Central Standard Time, UTC-06:00)
 Monday, March 03, 2008

Looks like some are really getting tired of the Winter already. I guess we had an unusual amount of snow, but I also recall that so far every winter I spent in Milwaukee there was some snow in April! ... So hang in there for a while :-)

Project

I already received some promising project ideas. Just for your information, typically (although not necessarily) your application will connect via the network to some kind of back-end or data source. You will get to know one mechanism to do this in class, Web services. This is perhaps the easiest way and also provides the opportunity to 'fake' some functionality with dummy data. After all you really can only provide a proof-of-concept in this short time frame.

Exam

The exam is ready to go ... you need to wait until the start date though, which is Tuesday evening. I don't think it will be as difficult as Elisha's chemistry exam, though ... and you have chance to get a couple of bonus points. Also, don't freak out when you submit the exam. The score you will see right after submitting the exam is incomplete, as there are several questions that need to be graded manually!

MH

Technorati :

3/3/2008 7:31:17 PM (Central Standard Time, UTC-06:00)
 Friday, February 22, 2008
The first assignment is completed and graded. This was the opportunity for everyone to get off to a good start ... (Note: Yes, you can get more than 100% on an individual assignment, since I did give a couple of bonus points). The next assignments will be a bit more challenging!

User-interface Design

I would like to take this opportunity to discuss some of the features and issues that I saw grading the assignment.

Here are some of the good practices that I saw implemented
  • guiding the user by only enabling relevant controls (or disabling irrelevant or distracting controls)
  • providing a clear squence of steps the user can to take to complete the task
  • clearing controls (i.e., textboxes) when the content is no longer used or could be inconsistent with other information on the screen
  • disabling input for controls that are only used for output (i.e., textbox displaying translation result)
  • making the screen design robust to obvious changes or extensions. Can your user-interface handle the addition of another language (or another phrase) without much modification?
  • providing feedback on user choices (i.e., highlighting selected language)
Some designs could have benefitted from reducing the number of active elements on the screen. Less is more (in my opinion) when it comes to user-interface design. Another issue was the lack of labeling input boxes. It should be clear to the user what kind of information goes into an input control.

Some of the user-interface design is a result of the logic of the process of arriving at the translation. Do you pick the language first and then the phrase, or vice versa?
Also some

Requirements Document and Use cases

Since this is a fairly simple application, the requirements documents were quite straightforward and done well. A couple of requirements documents could be improved by a crisper purpose statement. Keep in mind that this is what drives all the other parts and is also the thing that needs to get your reader (who might be the one who decided whether the project gets funded or not) hooked! It needs to be short and sweet, emphasizing the value of the application to the user and the organization. So this application is not about allowing "the user to choose between Spanish and German [...]". My favorite purpose statement was "The Language Translator will allow the user to translate useful vacation-oriented phrases from English into German and Spanish." Anything that is more than two sentences usually becomes convoluted and may be an indication the folks asking for this application don't really know what they want ... Big red flag for the project manager and his/her developers.

A use case should be a squence of detailed steps that a user would take to complete a specific task.  A use case should reflect one possible path, even if multiple alternatives exist. There is always the option to create multiple use cases (or variations of a use case) to reflect  different possible paths.  This will make it very straight forward to leverage use cases for testing down the road!

Submissions

I do want to also mention that it is important to make "professional" submissions (which most were). What does that mean?
  1. If possible put everything in ONE clearly formatted document.
  2. Put your name, assignment number, and class on the cover page of each document


We will take a look at UI design during our next class session.

... and this is what the moon during the lunar eclipse looked like in Whitefish Bay. (Lisa also took a nice shot!)



See the little white spek on the lower left?! ... That's Saturn.

MH
2/22/2008 3:43:52 PM (Central Standard Time, UTC-06:00)
 Monday, February 11, 2008

Again some nice blog entries, some with photos. The photos were nice, however, this may be a good point to point out that the photos can be resized to better fit the blog. Here is one way of doing this if you are using the blog editor that comes with DasBlog.

Adding images to the blog

  1. Sign in and go to 'Add Entry'.
  2. Click on the 'Insert Image from Gallery' icon on the tool bar of the editor.
  3. A new window with your image gallery should open.
  4. First an image needs to be uploaded to the blog. Browse to the image file and click upload. If you want to be more organized, you can create subfolders!
  5. Once the image(s) is(are) uploaded, select the desired image in the gallery.
  6. Then check 'custom dimension' on the right hand side and provide the size information (something around 400 pixels usually work well).
  7. Now set the properties (i.e., center the horizontal alignment, provide a title, etc.)
  8. click on 'Insert' and go back to your blog window.

It is also possible to switch to the HTML view in the blog's editor and work directly with the HTML image tag (img).

Of course you can also resize the image with your favorite image processing tool (i.e., PhotoShop or the Microsoft Image Manager) before you post it to the blog.

Visual Studio

Most people seem to have made progress with installing Visual Studio, however there are still some lingering issues. One problem that occurred is that one student reached a situation where attempts to install Visual Studio have failed and now the allow limit of installs has bee reached. I will have to investigate and see what can be done. One solution may be to download the file again (I think everyone has at least two attempts).

If you are encountering issues, talk to me during the break.

MH


Powered by Zoundry

2/11/2008 8:18:42 PM (Central Standard Time, UTC-06:00)
 Thursday, February 07, 2008

IMG_1415b.JPG

The snowstorm came after all, allthough a bit later than anticipated. While the roads where a bit slippery Tuesday evening, there was not too much snow then and I hope everyone got home safely.

Since we ended class a bit earlier, we need to catch up / postpone a few things.
The discussion of our first reading will take place next class session. If you have not submitted your lessons/questions yet, please do so on the course Web site's readings page.

Regarding Visual Studio and buring the ISO file to CD, I personally prefer not to burn them to a physical CD. A) Waste of a CD, B) CD burning can still be a bit unreliable and you may encounter problems with errors on your CD. Thus, I would use a virtual drive (or DVD/CD emulator).
However, burning the ISO file to CD may be the more straightforward option, if you already have the burning software in place and a CD drive that writes reliably.

MH


2/7/2008 11:41:41 AM (Central Standard Time, UTC-06:00)
 Monday, February 04, 2008
Finally the emails for Visual Studio were sent out correctly. But things apparently changed on the MSDNAA Online Software System Web site and a couple of other issues came up ...

Visual Studio 2005 - Download or no download?


If you visit the MSDNAA Online Software System Web site (for the UWM Business School) there is a list of software products, including the Visual Studio .NET 2005 Professional - Full Install . And this is what students will need for this course. However, clicking on this link one only gets the option to order the CDs for $34.95. What happened to the free download? It turns out that it is still there, but well hidden.

Here is how to get there. Go to the main software page with the list of products. There is a drop down list for "Search product by titles". This list contains the items Visual Studio 2005 Professional Edition - CD 1 (and another for CD 2). After selecting the item and clicking "Go" the option for free download appears.

Whether download or physical CDs, all the needed components are included. There should be no need to look for other components elsewhere. Also make sure it is Visual Studio 2005 not 2003.


How to deal with the downloaded ISO image?


The download file is an ISO image of the CD. This means a burning tool that can burn an ISO image to a CD is needed. This cannot be accomplished by using the out of the box functionality provided in Windows. Check if you have a CD/DVD burning tool (i.e., Roxio Easy CD Creator) on your machine. If not, there are free tools for download (i.e., CDBurnerXP) . There is also an option that circumvents the need to burn a physical CD. There are CD/DVD emulators such as Magic Disc that take the ISO image file directly and mimic a CD/DVD drive.




Technorati :

2/4/2008 2:01:30 PM (Central Standard Time, UTC-06:00)
 Tuesday, January 29, 2008

The blogs seem to be working well. Quite a bit to read for the first week :-)

I think there are a couple of things we should discuss in class, a few things we may talk about one-on-one during the lab session (i.e., login issues).

First, coding in teams of two is something we could consider for the project. The labs are very open and you are free to work with anyone you like. The key is that you understand the solution (and how you got to the solution) in the end. The assignments will be on an individual basis.

It seems that the ones that attempted the guided programming exercise in the book did well and even enjoyed working with Visual Studio. We will talk more about Visual Studio and how to work with it, including saving projects.

If you have been looking at the upcoming assignments already, you may have noticed some changes after the first class. I have inserted a different assignment as the first assignment. It is due earlier, but it is much easier and a "non-coding" assignment. I have removed the last assignment. So overall the assignments should be quite a bit easier than in the previous course. This should help people with little experience to succeed. The "pros" still have the opportunity to shine in the project.

Otherwise I hope everyone enjoyed the weekend. As you can see below, I did ...


MH



Technorati :

1/29/2008 9:24:39 PM (Central Standard Time, UTC-06:00)
 Wednesday, January 23, 2008

Realizing the moving button involves a bit more than I wanted to show in a first example. But if you are interested, here is a solution. The solution is intentionally quite verbose. This could be written in a much more compact way. However, it is easier to understand if the code is broken up in several lines. This solution is still rather simplistic. For instance, the button just goes up and it does not take into account the boundaries of the form.

MH

Code below:

Private Sub btnDemo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles btnDemo.Click
Dim x As Integer
Dim y As Integer
Dim newY As Integer
Dim newLocation As System.Drawing.Point

'get X coordinate of current location
x = btnDemo.Location.X
'get Y coordinate of current location
y = btnDemo.Location.Y
'calculate new Y coordinate (20 pixels up)
newY = y - 20

'Set new Y coordinate
'This does not work as the Location.Y coordinate is read only
'Button1.Location.Y = newY

'But a new location point can be created and assigned as a whole
'create new point with new Y coordinate
newLocation = New System.Drawing.Point(x, newY)
'set new point as location of button
btnDemo.Location = newLocation
End Sub


Technorati :

Powered by Zoundry

1/23/2008 4:40:47 PM (Central Standard Time, UTC-06:00)
 Tuesday, January 22, 2008
Welcome everyone to the first week of
Management Information Systems Concepts and Languages
(BUS ADM 740)

This is my (the instructors') blog. Every student in this class also has their own blog (see blogroll on the right).
The blogs allow students and instructors to reflect on the course, report on their personal progress and challenges, ask questions, and let others know about interesting things that may be relevant to the course.

Everyone is required to post to the blog at least once a week. Sometimes post may be short, but there will always be something happening in the course every week!

I look forward to an at times challenging, yet overall rewarding semester for everyone,

MH





1/22/2008 4:31:55 PM (Central Standard Time, UTC-06:00)
 Thursday, May 03, 2007

So it is time to wrap your project and get it ready for a presentation next week. If there are any questions in the meantime send an email. ... You will have a chance to make some modifications for your final deliverable after the presentation.

In the end (or even prior to the presentation if possible) I would like to have a CAB file to deploy your projects onto my PDA.

Just in case you are curious, I put my survey application out on the g-drive (see surveyApplication.zip in code folder).

(For the survey guys: There is no expectation that your project looks anything like this. Keep on following your own approach.)

MH


Technorati : ,

Powered by Zoundry

5/3/2007 2:34:21 PM (Central Standard Time, UTC-06:00)
 Thursday, April 26, 2007

OK, I started out just trying to implement for the Smart Device application what I had in the sample Windows Forms calendar application ... but I got carried away a bit as you can see when you download the sample calendar application for the smart device.

First, and perhaps most important, how to get the bolded dates. There is no AddBoldedDates method for the MonthCalendar control in the .NET Compact Framework. The answer is the BoldedDates property that is available. An array of dates can be assigned to this property. So the trick is to first create an array of dates (i.e., Dim myDates As Date() ), fill this array with the relevant dates, and then assign the array to the BoldedDates property (i.e., MonthCalendar1.BoldedDates = myDates ) ... that's it!

I like to use the ArrayList as a flexible array container whenever I do not know the number of items that need to go into an array. So I fill the array list with my dates ( al.Add(thisDate ) and then turn the array list into an array of dates ( al.ToArray(GetType(Date)) ).

Then I thought, it would be nice if I could already see the calendar and work with the UI while my Web service is busy getting the calendar information from Google. So I went ahead and implemented an asynchronous Web service call. Rather than calling the getGoogleCalendar method I use the asynchronous BegingetGoogleCalendar method. This method does not return the calendar, instead it just kicks off the Web service. I now need an event handler that is executed when the Web service returns something. In the .NET Framework this is very convenient ... not so in the .NET Compact Framework.

On top of that I thought it might be nice to have progress bar show move along while the Web service is working. Again this involves a bit more work in the .NET Compact Framework. I need a timer and a timer tick event handler in which I update the progress bar.

And then I also needed to wrap the updating of the calendar and the stopping of the progress bar into an event handler and invoke the event handler ... but now it works!!!

There is no expectation that you use asynchronous Web service calls, but you at least know now how to get the bolded dates.

MH

BTW, the sample calendar application for the smart device is zipped up in the code folder on the g-drive.

Technorati : , ,

Powered by Zoundry

4/26/2007 8:05:07 PM (Central Standard Time, UTC-06:00)

Here is the link to the Patient Management Service: http://www.531.sba.uwm.edu/mhaines/740/WebServices/PatientManagementService.asmx

To complete assignment #4 you can also use the service mentioned in lab #4.

MH


Technorati : ,

Powered by Zoundry

4/26/2007 12:50:35 PM (Central Standard Time, UTC-06:00)
 Tuesday, April 24, 2007

This entry does not address the issue of getting the emulator to connect, but here is an example of how you can find out whether your Pocket PC is currently connected to the Internet in your application.

This is based on http://msdn2.microsoft.com/en-us/library/aa446548.aspx, however the Microsoft example uses a) obsolete functions and b) does not work if IPv6 is also being used. Here is my improved code ...

    Private Function isConnected() As Boolean

        Try
            ' Returns the Device Name
            Dim HostName As String = System.Net.Dns.GetHostName()
            Dim thisHost As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(HostName)
            Dim thisIpAddr As String = "127.0.0.1" 'not connected

            For Each ipa As Net.IPAddress In thisHost.AddressList
                If ipa.AddressFamily = Net.Sockets.AddressFamily.InterNetwork Then
                    thisIpAddr = ipa.ToString()
                    Exit For 'found first IP address
                Else
                    'continue
                End If
            Next

            'return the result of the comparison of this IP address with 127.0.0.1 (not connected)
            Return thisIpAddr <> Net.IPAddress.Parse("127.0.0.1").ToString()

        Catch ex As Exception
            Return False
        End Try

    End Function

Powered by Zoundry

4/24/2007 1:58:45 PM (Central Standard Time, UTC-06:00)