Windows XP and Office 2003 Support Ends by Microsoft, But Hey, I'm Still Here!!

When you're windows XP takes a turn, or your office 2003 does something weird, don't forget about me, even though you'll get "We no longer support that release of windows from big Micro$oft" I'll be happy to help, and with 26 years of experience it won't take long either. Sure you can call the "big box" geeks, but, they'll take all day and then tell you, you should reformat your hard drive and start over or worse yet, tell you to upgrade and get help from Microsoft.

Sure the choice is yours, but, spend a little now on a real company that really works as if it was their stuff or call someone who only cares about a buck or two.

PS. I do websites, and web hosting too!!!!

(advertisement)

Creating a Reverse Order for a DataGrid in ASP.Net using vb code

I searched high and dry for a code example of this, so here is the scenario: I have a calendar that (of course) can record any number of appointments, but, I only wanted to show the most recent 4 entries on a home page. So easy enough I tell the SQLDatasource to give me the top 4 based on the start date in descending order. Now the problem: well, since I'm displaying the entries in a templated gridview I want the next four events listed from the next one to the last one (reverse order).



My solution: Here is the Code from the web page (aspx):

<asp:HiddenField ID="CurrentDate" runat="server" />
<asp:SqlDataSource ID="AppointmentData" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT top 4 [StartDate], [Subject], [UniqueId] FROM [Appointments] WHERE ([StartDate] &gt;= @StartDate) ORDER BY [StartDate] desc">
    <SelectParameters>
        <asp:ControlParameter ControlID="CurrentDate" Name="StartDate" PropertyName="Value" Type="DateTime" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:DataGrid ID="AppointDataGrid" runat="server" DataSourceID="AppointmentData" AutoGenerateColumns="False" ShowHeader="False" Style="margin-right: 31px" Width="200px" BorderStyle="None" BorderWidth="0px" GridLines="None" PageSize="4" AllowSorting="True">
    <Columns>
        <asp:TemplateColumn>
            <ItemTemplate>
                <ul class="list-style2">
                    <li class="first">
                        <asp:HiddenField ID="StartDate" runat="server" Value='<%# Eval("StartDate")%>' />
                        <asp:HiddenField ID="Subject" runat="server" Value='<%# Eval("Subject")%>' />
                        <strong class="date" style="padding-right: 5px"><span class="month"><%# DataBinder.Eval(Container.DataItem, "StartDate", "{0:MMM}")%></span> <span class="day"><%# DataBinder.Eval(Container.DataItem, "StartDate", "{0:dd}")%></span></strong>
                        <%# Eval("Subject")%>
                    </li>
                </ul>
            </ItemTemplate>
        </asp:TemplateColumn>
    </Columns>
</asp:DataGrid>


Here is the code behind:

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            CurrentDate.Value = Now
            AppointmentData.DataBind()
            Get_GridData_RVS()
        End If
    End Sub

    Sub Get_GridData_RVS()
        Dim ds As New DataSet()
        Dim dt As New DataTable()
        dt.Columns.Add("StartDate", GetType(Date))
        dt.Columns.Add("Subject", GetType(String))
        ds.Tables.Add(dt)
        For i = AppointDataGrid.Items.Count - 1 To 0 Step -1
            Dim nw As DataRow = ds.Tables(0).NewRow()
            nw("StartDate") = Convert.ToDateTime(DirectCast(AppointDataGrid.Items(i).FindControl("StartDate"), HiddenField).Value)
            nw("Subject") = DirectCast(AppointDataGrid.Items(i).FindControl("Subject"), HiddenField).Value
            ds.Tables(0).Rows.Add(nw)
        Next
        AppointDataGrid.DataSourceID = Nothing
        AppointDataGrid.DataSource = ds
        AppointDataGrid.DataBind()
    End Sub


Which Looks Like:

 

Now some explaining:

  1. I first layout my SQLData source and attach my database criteria.
  2. I add a hidden filed to store todays date in.
  3. I add the datagrid and create the template column for displaying the data as if it wasn't in a datagrid at all.
  4. In the page load event I store todays date to the hidden field (I added in step 2), and bind the data to the SQLDatasource.
  5. Call the code to change the order of the data and bind that changed data to the grid.
  6. The code that changes the order creates a temporary data table, then we loop through the datagrid in reverse order and load the data table with that data, then it binds the data table to the datagrid and "wha la" done!!!

I know this will help someone, because there were so many questions on Google about it and no real complete answers, just partial answers.

My Notebook Won't Connect to My New N750 Linksys Router or When You're Not Holding All The Aces Your Holding The Bag

Holding All the Aces
My ever faithful US Robotics Router has been acting very intermittent lately, so it was time to replace it. After all, the servers that sit behind it run this site and some others and we can't have those down. So, with a little research I ended up with a Linksys N750 (EA3500) router. Configuring the basic router functions went pretty easily, it did take a while to find where to input the virtual settings so the servers would get pass thru on the correct ports. But, all in all it went pretty well and those functions wouldn't be used by a typical household.

UNTIL.... I went to configure my notebook to connect to the wireless part of the router.

Holding the Bag
After using the settings that came with the router for wireless access, my notebook asked for the pass code (as normal), I supplied it, but, unfortunately it wouldn't connect. I thought it must be in that new fangled WPA2/WPA Mixed setting. After all it's too simple to just supply the wireless password and everything would work right? right! After all the usual computer consulting trouble shooting, I changed the settings to the old standard WEP, still no dice. Linksys support website said to attempt the connection put in the password and you'll connect, then asked "Was this information helpful?".  But what if that doesn't work? What now?

(advertisement)

 

This is where we have to think small, and start methodically. Here's what to do:

  1. Unplug the Linksys Router, wait about 20 seconds and plug it back in. Wait for it to boot up completely.
  2. Restart the device (in my case my notebook) and attempt the connection.
  3. It Worked.

Amazing how much, just resetting clears the confusion in a device sometimes. So, next time before you make the call, check the connections, power down the devices and try one last time. BTW, there is an order to starting network devices and each one should be completely up before you move on to the next one, and they are: Modem, Router, Switch, Computer.

(advertisement)