Some times we installed the wrong authentication mode for Microsoft SQL Server 2000 and 2005.
It would be quite troublesom to configure web application connection string or way to connect the
windows authentication database server.
Hope the solution as below help!
You can re configure SQL Server with windows authentication mode to mixed mode authentication.
For MSSQL Server 2000
======================
1. Launch Enterprise Manage for SQL Server 2000.
2. Right click current active database server (Usually named local) 's "PROPERTY".
3. Click on the "SECURITY" tab, and change:
Authentication
- Tick "SQL SERVER AND WINDOWS radio button
Audit Level
- Tick "None"
Ownership Chaining
- Uncheck
4. Startup service account
- Tick "System account"
5. Restart server
For SQL 2005 Express Edition
============================
No GUI tool available to configure the server it to MIX MODE!
You need to go it manually. The first step is to change the login-mode.
1. Press Window Key + R ( Run ) and key in regedit to launch Registery Editor.
2. Go to HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer in the tree on the left.
3. On the right, look for an entry named LoginMode.
The default value would be 1.
Now change it to 2 ( HEX )
4. Restart the SQL Service.
Type services.msc in the RUN to launch your Service Manager (Start -> Run -> Type services.msc)
and look for a service named MSSQL Server (SQLEXPRESS).
Right Click and Restart the service.
In this stage, if you already have an exisiting SA user, make sure you enable the SA user.
Configure a valid SA User properties:
1. Open SQL Management Studio
2. Connect via windows authentication ( use windows authentication to change the SA user property to be valid )
3. Under current SQL Server > Security > Logins > Double Click on SA user.
a. Change the password
b. Uncheck "Enforce password policy" if not needed
c. Default database set to "master"
d. Default language set to "english"
4. Property of Server Roles, Check on "public" and "sysadmin"
5. Property of User Mapping, Map databases with User (dbo) and Default Schema (dbo) value.
6. Property of Status,
a. Permission to connect to databse engine, set to "Grant"
b. Login, set to "Enabled"
or you can use command prompt way:
To add a user with administrative priviledges so that the database can be accessed from ASP.Net.
On the command prompt, login to SQL Server command prompt using the osql utility.
SQL Server 2005 Express Edition is installed with the instance name SQLEXPRESS.
Use the following command to login:
=============================
osql -E -S .\SQLEXPRESS
=============================
One the SQL-command prompt, execute the following?
1> exec sp_addlogin 'username', 'password'
2> go
1> exec sp_addsrvroleadmin 'username', 'sysadmin'
2> go
1> quit
Replace the username and password but not forget the quotes. To verify, try login using the following on the command prompt:
=================================
osql -S .\SQLExpress -U username
=================================
Provide the password when asked.
Technology, Art, Solution, Tips, Multimedia, How To, What Is, Programming, Software, Freelance
Mar 12, 2008
ASP Clasic System Locale Setting With Session.LCID
LCID stands for Locale Identifier
Example of usage:
If you using ASP Classic Functions such as MonthName(xxx), Date(xxx) and etc, your web application will converting the month's name base on your server regional / locale settings.
Let say your server locale is Chinese (PRC ) settings, you may get a chinese charater of month being shown at the website.
Suggested solution for this would be:
reset the locale identifier at the page initialize stage
Example as below:
Session.lcid = 1033 ' English US
Session.lcid = 3081 ' English Australia
LCID might affected other formats such as the format of date time and currency value.
Example:
For 1033, date format would be mm/dd/yyyy and 3081 would be dd/mm/yyyy
List of LCID
http://www.microsoft.com/globaldev/reference/lcid-all.mspx
http://www.science.co.il/Language/Locale-Codes.asp?s=decimal
Example of usage:
If you using ASP Classic Functions such as MonthName(xxx), Date(xxx) and etc, your web application will converting the month's name base on your server regional / locale settings.
Let say your server locale is Chinese (PRC ) settings, you may get a chinese charater of month being shown at the website.
Suggested solution for this would be:
reset the locale identifier at the page initialize stage
Example as below:
Session.lcid = 1033 ' English US
Session.lcid = 3081 ' English Australia
LCID might affected other formats such as the format of date time and currency value.
Example:
For 1033, date format would be mm/dd/yyyy and 3081 would be dd/mm/yyyy
List of LCID
http://www.microsoft.com/globaldev/reference/lcid-all.mspx
http://www.science.co.il/Language/Locale-Codes.asp?s=decimal
Mar 10, 2008
Tips To Validate Online Banking Fake or Phishing Site
Phishing site would be a site which created very similar to the original website to trap user.
If you didn't take note of several security validation, you might probably entering your user id and password to the phishing site, and the owner of the phishing site will get all your login information and able to access your real account then.
You can always call to those online banking site if you suspect the site is a fake or phishing site.
Here by would be some tips to validate our local Maybank2u site:
1. URL
You have to always be careful and notice the Url of your site.
Take note of
a. URL Protocol : e.g: always be https:// ( for secure online banking system )
b. Domain Name: always be a valid or related domain name and not those xxyyzz.aa
c. Query String: always be a valid query string but not those weired one.
Below figure is Maybank2u site which always reporting latest fake or phishing site.
Take note if you found your current Maybank2u site URL are listed at the red circle in the figure.



2. Always check for security certificate of site owner.
How to check ?
a. Always note on the right bottom site would show a LOCK icon whenever it is a https secure site.
b. Right Click the page > Property of the page > Click on the Certificate button
You will get to know this certificate is issued to which owner.
In this case would be www.maybank2u.com.my
and is issued by www.verisign.com.
Besides, you will get validity period from when to when.
Go for the certificate path tabs and check for the certificate status whether it is ok or not.

3. Be advised that not to open pages via email links or IM links
Those unknown source of links might have hidden query string and will divert the page to a phishing site.
If you didn't take note of several security validation, you might probably entering your user id and password to the phishing site, and the owner of the phishing site will get all your login information and able to access your real account then.
You can always call to those online banking site if you suspect the site is a fake or phishing site.
Here by would be some tips to validate our local Maybank2u site:
1. URL
You have to always be careful and notice the Url of your site.
Take note of
a. URL Protocol : e.g: always be https:// ( for secure online banking system )
b. Domain Name: always be a valid or related domain name and not those xxyyzz.aa
c. Query String: always be a valid query string but not those weired one.
Below figure is Maybank2u site which always reporting latest fake or phishing site.
Take note if you found your current Maybank2u site URL are listed at the red circle in the figure.



2. Always check for security certificate of site owner.
How to check ?
a. Always note on the right bottom site would show a LOCK icon whenever it is a https secure site.
b. Right Click the page > Property of the page > Click on the Certificate button
You will get to know this certificate is issued to which owner.
In this case would be www.maybank2u.com.my
and is issued by www.verisign.com.
Besides, you will get validity period from when to when.
Go for the certificate path tabs and check for the certificate status whether it is ok or not.

3. Be advised that not to open pages via email links or IM links
Those unknown source of links might have hidden query string and will divert the page to a phishing site.
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 ==========
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)
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
......
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
......
Subscribe to:
Posts (Atom)