Feb 26, 2008

How To Get Windows Mobile Application Pre-Requisite CAB

When you debug and deploy your mobile application with visual studio 2008, you will get some information may help on your real deployment process.

Eg. the out here below will show the cab you needed for client, get those cab from the specific path and deploy it with your program together in order to make it work.

For database, you might need to be aware of the path of database. Default location is device program files.

------ Deploy started: Project: Ringamon, Configuration: Debug Any CPU ------

'// For my HP IPAQ RW 6828 on Windows Mobile 5 qVGA 320x240
Deploying 'C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\windowsce\NETCFv35.wm.ARMV4I.cab'

'// SQL Server Compact Edition ( PPC WCE5 )
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.ppc.wce5.armv4i.CAB'

'// SQL Server Compact Edition ( Repl ppc version )
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.repl.ppc.wce5.armv4i.CAB'

'// SQL Server Compact Edition ( DEV enu version )
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i\sqlce.dev.enu.ppc.wce5.armv4i.CAB'

'// My Ringamon Database
Deploying 'C:\Users\Ethan Liew\Desktop\Ethan.Mobile.Ringamon\trunk\Ethan.Mobile.Ringamon\bin\Debug\db.sdf'

'// My Ringamon program :P
Deploying 'C:\Users\Ethan Liew\Desktop\Ethan.Mobile.Ringamon\trunk\Ethan.Mobile.Ringamon\bin\Debug\Ringamon.exe'

Deploying 'C:\Program
'// Result of diagnostics message / error message
Files\Microsoft.NET\SDK\CompactFramework\v3.5\windowsce\diagnostics\NETCFv35.Messages.EN.wm.cab'

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========









DBNETLIB SQL Server Error 17 with SQL2000 Windows Authentication


If your SQL Server 200 had been initially installed using Windows Authentication ( Windows only ) option as above figure, you may have hard to to connect via Odbc or Sql Management Studio 2005.

You might get the error bellow.



Solution might be getting windows authentication before you connect your machine to sql 2000 server.

You can type in machine name or IP and try to key in the sql2000 server administrator and password ( authenticated user ) for sql 2000.


Then you will able to attach the sql server 2000 on your sql server management 2005.





Feb 21, 2008

Validate Input Values With Message List

Private Function ValidateInputValues(ByVal control As Control, ByVal pageType As PageType) As ArrayList
Dim messageList As ArrayList = New ArrayList()
DataFormat.SetDateSeparator("/")
If (pageType <> PageType.Search) Then ' Add/Edit Validation
Dim fullName As TextBox = TryCast(control.FindControl("fullName"), TextBox)
If (fullName IsNot Nothing) Then
If (Not DataFormat.CheckString(fullName.Text)) Then
messageList.Add("Invalid Value (String): fullName")
End If
End If
Dim phoneNumber As TextBox = TryCast(control.FindControl("phoneNumber"), TextBox)
If (phoneNumber IsNot Nothing) Then
If (Not DataFormat.CheckInt32(phoneNumber.Text)) Then
messageList.Add("Invalid Value (Int32): Phone Number")
End If
End If
End If
Return IIf(messageList.Count = 0, Nothing, messageList)
End Function


' Powerful TIPs !
Dim source As WebControl = TryCast(sender, WebControl)







Page Load Function Tips

Get some idea or tips from others work in their page load():

Protected Sub Page_Load(ByVal s As Object, ByVal e As System.EventArgs)

' Registering external javascript file, so that we can have more neater js file management.
Page.ClientScript.RegisterClientScriptInclude("ethan", "ethan.js")

' Cache Setting, I just know about
' ASP Caching can be set manually on the virtual directory property
Response.Cache.SetCacheability(HttpCacheability.NoCache)

' Auto-find control and set focus to it;
' I just know got such a syntax, which really near to human language syntax "IsNot"
' and about ClientID property which is very useful in some case.
If (tblpwdDetailsView.FindControl("fullName") IsNot Nothing) Then
Page.Form.DefaultFocus = tblpwdDetailsView.FindControl("fullName").ClientID
End If

' The way they check for QueryString exist or not
If (Not Page.IsPostBack) Then
If (Request.QueryString.Count > 0) Then
......




Team Viewer Remote Access


http://www.teamviewer.com/download/index.aspx


File Transfer Mode


File Transfering


Login ID







Feb 20, 2008

MMC cannot open the file C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC.



Case:
When you click on "SQL Server Enterprise Manager" shortcut,
you get "MMC cannot open the file C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC.
This may be because the file does not exist, is not an MMC console, or was created by a later version of MMC. This may also be because you do not have sufficient access rights to the file."

First I try to check the NTFS Security Permission and is already set to administrator.
Probably the file had corrupted.

Suggested solution:
  1. Select Start - Run.
  2. At the Open prompt enter: mmc
  3. Click OK
  4. Select File - Add/Remove Snap-in...
  5. Click Add...
  6. Select Microsoft SQL Enterprise Manager
  7. Click Add, then Close
  8. Click Ok to return to the mmc.
  9. Select File - Save As...
  10. Delete or rename the original (offending) file out the way.
  11. Save the new msc file as C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC

Now your original shortcut should work.

Alternatively you can always access Enterprise Manager from within the Computer Management mmc.

Reference From: http://geekswithblogs.net/timh/archive/2005/08/09/49716.aspx
Thanks to Tim Huffam (geekswithblogs) and Sin Huei ( my college)







Converting Valid XML String To Dataset

Imports System.Text
Imports System.Xml
Imports System.Data
Imports System.IO

Dim sb As New System.Text.StringBuilder
sb.Append("")
sb.Append("")
sb.Append("" & "Ethan Liew" & "")
sb.Append("" & "info@ethanliew.com" & "")
sb.Append("
")
sb.Append("
")

' Covert to string reader then to xmltextreader
Dim reader As New XmlTextReader(New StringReader(sb.ToString))
Dim ds As New DataSet
ds.ReadXml(reader)

' Return dataset
Return ds

1. First you need to use StringReader to read the string.
2. Convert it to XmlTextReader
3. Create a new dataset to






Feb 19, 2008

Windows Experice Index and Vista Rating


My machine vista rating. so far so good ?

What is the Windows Experience Index?

The Windows Experience Index measures the capability of your computer's hardware and software configuration and expresses this measurement as a number called a base score. A higher base score generally means that your computer will perform better and faster than a computer with a lower base score, especially when performing more advanced and resource-intensive tasks.

Each hardware component receives an individual subscore. Your computer's base score is determined by the lowest subscore. For example, if the lowest subscore of an individual hardware component is 2.6, then the base score is 2.6. The base score is not an average of the combined subscores.

You can use the base score to confidently buy programs and other software that are matched to your computer's base score. For example, if your computer has a base score of 3.3, then you can confidently purchase any software designed for this version of Windows that requires a computer with a base score of 3 or lower.







Recommend Reading:

Accessing Web.Config AppSettings Collection Value

Web.config Settings:

** replace ( to < ** replace ) to >

(appSettings)
(add key="ContentFrameHeight" value ="600px"/)
(add key="ContentFrameWidth" value="700px"/)
(add key="MenuFrameHeight" value="400px"/)
(add key="MenuFrameWidth" value="250px" /)
(/appSettings)


Usually AppSettings placement:
configuration
configSections
"AppSettings"
system.web


Before using System.Configuration.Manager
We might need to add .NET reference, because by default this reference might not be added.
1. Right click "Add reference" > Add the System.Configuration as below figure.



Then you can apply the syntax below:


E.g syntax:
Dim height As String = ConfigurationManager.AppSettings("ContentFrameHeight").ToString

Accesing Master Page With IFRAME Property From Code Behind

Sometimes we need to access code front controls property from code behind, so that we can create a dynamic or configuration variable for this purpose.

How we know what property we have in the code front controls?
In the code front, we can get intellisense helps to verify whether it is a syntax or property with different colors.

ASP.NET Code Front:

(asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server")
(iframe id="mainContent" name="mainContent" src="../Dev.aspx" width="700px"
scrolling="auto" frameborder="0" marginheight="0" marginwidth="0" runat="server"
title="E-Application Content")(/iframe)
(/asp:Content)

** replace ( to < ** replace ) to >


ASP.NET Code Behind:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
mainContent.Attributes.Add("Height", "700px")
End Sub


Explanation:
IFRAME ASP.net Code behind having an "Attribute" syntax where we can simply accessing the value of controls in front page. Yet, code front control needed to be "runat=server" mode.

We created a master page, within the master page we have content place holder setup.
Then we create a new page and inherits master page layout.

In this case, we might still need to use traditional html href link to open a page onto a target.
We can use IFRAME with the id and NAME ( name is needed here ) and shown the page on the IFRAME.

With the code above, we can manipulate IFRAME property during page load.

Feb 15, 2008

XPAntivirus.com is a Fake Online Anti Virus

Well, Just got a feedback comment from my reader named Malabei.

Thanks for visiting and drop by the comment.

Usually comment or message posted look similar as below:

"I first visited your blog, but my antispyware said that he is infected with an unknown virus.
I deleted the virus through this AntiSpyWare.
The virus does not manifest itself but gradually destroys information on the computer."

You probably have to be extra careful of those HiJacker

I had gone through the process ( Although I know it is a fake one, so that I can get more information to share with my readers )

HOW THEY HIJACK YOUR PC?
If you are not careful enough, you probably will follow the link as what they leave at the forum, blogs, website or even through instant messenger.

It will brings you to a new page where it requests your authorization or permission to let hacker hijacks your local machine.

Here is the XPANTIVIRUS .com screen shot.
It prompts you to make a virus scan on your machine.
Please DON'T ALLOW it!

You can get some clue stated below to identify whether this is a fake one or not.
1. Did you feel the URL sound too "nice" or "easy to understand" if compare with other antivirus software name.
2. OOoo it is totally FREE! There are FREE anti virus, but not this.
3. Wow, it able to SERVE you and PROTECT you for all aspect (virusese, spyware, adware ) !!
( even AVG give Free antivirus ONLY)
4. The word "Install" , you have to really check out who is the party produce that software, are they Trusted company? or having Certificate for the site ? VeriSign , AntiHacker validation ?
5. The word "Recommended" is just nice word to "fish" you.



Well, if you ignore the pop up. It brings you to this site too.
Noted that, the animation or programming on the web is really look like scanning your machine, although you din't allow them to scan your machine previously.
So, it is all FAKE!!

After scanning ( actually is an animation only ), it will prompt you, your machine is infected by viruses as shown on the right red box.

Then it started to prompt you to download their anti virus or any other utilities to clean the viruses. Please refer to valid anti virus site to get more information about virus details.
You can even email the symptom of viruses to genuine anti virus company for a verification.

If you met this screen shot, DON'T Donwload the fake anti virus!


If it is too late for you, you had donwloaded and installed.
Don't panic! You can refer these site to get them out of your box.

http://www.2-spyware.com/remove-xpantivirus.html
http://www.symantec.com/security_response/writeup.jsp?docid=2007-101010-0713-99
http://www.bleepingcomputer.com/forums/topic111715.html



Google Android


(image credit: Google )

Google launched new software for mobile on last Nov named Android.

The Android platform consists of an operating system, middleware, a user-friendly interface, and applications.

Consumers should expect the first phones based on Android to be available in the second half of 2008 =)


image credit: Google

According to CNET News (http://www.news.com/8301-10784_3-9871542-7.html?tag=cd.blog)
Development Kit had been launched.


image credit: Hello Android


image credit: HelloAndroid


For more UI Screen shot, can refer http://www.helloandroid.com/node/258






Redirection 301 Moved Permanently

Wow... nearly one month din't update my blog. Due to busy on Chinese New Year 2008 celebration and outstation for business trip.

Today's tip, to create a SEO friendly redirection method:

Search engines have indexed your entire site and many pages rank well. By moving and renaming these files, you run the risk of losing a lot of traffic and leaving visitors to your site who follow a search engine link with the dreaded "Error 404 - File not found"


There are several way recommended:
1. 301 Redirection
The code "301" is interpreted as "moved permanently". After the code, the URL of the missing or renamed page is noted, followed by a space, then followed by the new location or file nam




2. Meta Refresh / Redirect
This method always used by spammer to redirect their page to itself, so that they can get the counts. This is so called illegal traffic. Thus, use this method wisely.

The code will be located in the header tag.