Using Mailto in ASP:HyperLink

So I wanted to add a mailto link in my code. I knew that it would be something to do with the asp:HyperLink control but was not sure how to use it. After a little testing I found this information out.

So I had pulled my email address from a SQL statement and wanted to add it to the control, this was my first attempt:

<asp:HyperLink ID="hlEmail" NavigateUrl="mailto:" Text='<%# Bind("Email") %>' runat="server"></asp:HyperLink>

This gave me a HyperLink but with a blank mailto, well that was no good. So next I got to thinking that I need to stick a Bind or Eval with the text on the NavigateUrl section:

<asp:HyperLink ID="hlEmail" NavigateUrl='mailto:<%# Bind("Email") %>' Text='<%# Bind("Email") %>' runat="server"></asp:HyperLink>

This gave me a link, but it do not work. Every time I clicked on the link nothing happened. Again I tried some more code and came up with the following:

<asp:HyperLink ID="hlEmail" NavigateUrl='<%# Bind("Email", "mailto:{0}") %>' Text='<%# Bind("Email") %>' runat="server"></asp:HyperLink>

This worked, so it was to do with formatting the string.  By using the in built string formatting options I was able to pass the Bind vale to the NavigateUrl parameter. Easy when you know how.

So I was looking for a SQL Browser to use with Oracle

I’ve been recently looking for a SQL Browser Tool to use with Oracle, but also wanted it to work with a few other databases that I work with, such as MS SQL, DB2 and My SQL.  So off to the internet I went and did some searching around. After a while I came across a product called RazorSQL and checked that it would work with the database that I required and with Windows 7, and it did!!  Great, so I downloaded the trial, installed and connected it to all the databases that I wanted.

I found the product really easy to use and some of the features are really good, some of which I would of only expected to find in a really expensive add-on by one of the original DB manufacturers. After the trial period was up I bought a RazorSQL registration and I’ve been using this ever since.  Great product!!

 

 

MS Exchange 2007 does not show some users with Manage Mobile Device

So I found that I had some users that were not showing “Manage Mobile Device” within the Exchange Management Console. So with a bit of browsing around on the Web I found the answer. Well, when I say the answer, it’s a method to switch the functionality back on for that user.

Fist you need to make sure that you can run ADSIEDIT.MSC  If not then you’ll need to download the Support Tools from Microsoft. They only seem to offer a 32-bit version but this did work on my 64-bit server so not to worry there. Here is the link to the download page, and make sure you download both files.

Windows Server 2003 Service Pack 2 32-bit Support Tools

Once you’ve downloaded and installed then run ADSIEDIT.MSC and it should open a window. Now look through the Tree in the Container USERS and find the user that has the problem. Right mouse click the user and click on properties. Scroll down the list and look for “msExchMobileMailboxFlags”.  Once found, select it and click EDIT and change the value to 1 if it’s not set. Then click okay.

You may have to restart the Exchange Management Console, but your user should now have the “Manage Mobile Device” listed against them now.

 

Vista Error 10107: A system call that should never fail has failed

So I had a user that booted up their Windows Vista system this morning and found that they could not get connected to the network. When I popped over I found that it was displaying an error message in a balloon from the system tray saying:

Failed to connect to a windows service.
Windows could not connect to the System Event Notification Service service. This problem prevents limited users from logging on to the system. As an administrative user, you can review the System Event Log for details about why the service didn’t respond.

Then when I looked at the Services on the machine a number had stopped working. When I tried restarting then I got the following error message: “Vista Error 10107: A system call that should never fail has failed”

At this point I looked around the Internet and found an answer. It would appear that its a Corrupt TCP/IP Winsock Catalog. The method for trying to fix this is:

  1. Start the PC in Safemode.
  2. Open and CMD prompt (press the Windows Key+R).
  3. In the CMD prompt type netsh winsock reset and press enter.
  4. Restart the computer.

This will reset the Winsock Catalog to either a clean slate or a previous configuration. It will remove all Winsock LSP (Layered Service Providers) previously installed, including any malfunctioning ones.

To check the LSP’s installed on your Vista system, use netsh winsock show catalog command.

 

How to Configure a Second or Third Router to an Existing LAN

I had a need to configure standard Netgear DG834 v3 ADSL Router (Router1) and then connect a Netgear DG834N ADSL2+ Wireless Router (Router2) off of Router1’s Network Port. The reason is so that I can move the Wireless Router (Router2) further down the building to cover the area where I need the Wireless Signal. Using this method I could now easily add an additional DG834N to the LAN and put that in another part of the building.

When doing this, the easiest way to connect a Router to the existing LAN is to connect LAN port to LAN port and configure the LAN side of the downstream router as compared to the WAN side.

Router1 – LAN Side Configuration

IP: 192.168.0.1
Subnet Mask: 255.255.255.0

DHCP Enabled = Yes
DHCP Scope:  192.168.0.50 to 192.168.0.254

Router2 – LAN Side Configuration

IP:  192.168.0.2
Subnet Mask:  255.255.255.0
Default Gateway:  192.168.0.1

DHCP Enabled = No

Notes

NetgearRouters

As you can see Router2 is inside of Router1’s subnet and Router2 does not issue out any DHCP addresses. The reason is so that you don’t have two routers on the same network giving out the same IP address.

With everything configured correctly, when a computer uses the Wireless network from Router2 it should get an IP address from Router1 and connect to the Internet.

If you added a second Wireless router, configure it the same as Router2 but with an IP address of 192.168.0.3 and of course a different SSID & Wireless Key.

 

 

Putting a Media Code into your ASP.NET Code

Ever wanted to display a Windows Media file on your Web Page. Then here is the answer and it works for both Internet Explorer and Mozilla Firefox. First declare a variable at the top of your page for use later on. This way if you arrive to this page from another you can handle what Media file gets shown.

<script runat="server">
  Public mySrc As String = ""

  Sub Page_Load()
    mySrc = "video/Wildlife.wmv"
  End Sub
</script>

Next Place this code on your page where you wish to see the Media.

<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="player" width="640" height="480">
  <param name="url" value="<%=mySrc %>" />
  <param name="src" value="<%=mySrc %>" />
  <param name="uiMode" value="mini" />
  <param name="autostart" value="true" />
  <param name="volume" value="50" />
  <!--[if !IE]>-->
  <object type="application/x-ms-wmp" data="<%=mySrc %>" width="640" height="480">
    <param name="src" value="<%=mySrc %>" />
    <param name="uiMode" value="mini" />
    <param name="autostart" value="true" />
    <param name="volume" value="50" />
  </object>
  <!--<![endif]-->
</object>

It’s as easy as that.

 

 

Giving Vista & Win7 the ability to access Xserve

I had the need the other day to make a desktop running Windows XP connect to an Apple Server for a user.  I setup a user on the OSX Server and then tried to connect to this machine from my Laptop to make sure that the account was working before I went over and tried to show the user and looked silly when it didn’t work. I found that my Laptop running Windows 7 would not work. Okay so off to Google and see what I can find. It appears that Vista & Win7 both have a different set of rights that stop the ability to set a Mapped drive to the Apple Server, LAN Manager Authentication:  Vista & Win7 defaults to “Send NTLMv2 response only”.

Here is what is needed to make it work:

Run secpol.msc

Go to: Local Policies –> Security Options

Find “Network Security: LAN Manager authentication level”

Change Setting from “Send NTLMv2 response only” to “Send LM & NTLM – use NTLMv2 session security if negotiated”

Needless to say, I got a connection and proved it worked, so was able to head over to the user and show them how to MAP a drive.