Feb 26, 2008

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: