Thursday, November 19, 2009

Unable to login when both Form Authentication and Windows Authentication is implmented

Error we were receiving :

Event code: 4006
Event message: Membership credential verification failed.
Event time: 19/11/2009 12:43:51 PM
Event time (UTC): 19/11/2009 1:43:51 AM
Event ID: 1bedfdd7dd734d0c8cbba1a3ae61c019
Event sequence: 112
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/80145796/Root/RubikIBS-23-129029908738237500
Trust level: Full
Application Virtual Path: /RubikIBS
Application Path: C:\Inetpub\wwwroot\mobi\RubikIBS\
Machine name: SWIFT_HOMEBANK

Process information:
Process ID: 8352
Process name: aspnet_wp.exe
Account name: SWIFT_HOMEBANK\ASPNET

Request information:
Request URL: http://10.11.3.17:4747/RubikIBS/Login.aspx
Request path: /RubikIBS/Login.aspx
User host address: 10.10.9.99
User:
Is authenticated: False
Authentication Type:
Thread account name: SWIFT_HOMEBANK\ASPNET

Name to authenticate: 1938113

Custom event details:

For more information, see Help and Support Center at


Well the issue was caused since the password in the database was changed hence it was authenticated via the forms authentication but it failed on Windows authentication

Saturday, November 7, 2009

Login failed for user 'username'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

Cause::

The SQL server has been configured to operate in "Windows Authentication Mode (Windows Authentication)" and doesn't allow
the use of SQL accounts.


Resolution::
Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".

Friday, November 6, 2009

Display decimal value as 2 decimal places in DataGrid

BoundColumn
<asp:BoundColumn ...... DataFormatString="{0:f2}"/>

TemplateColumn
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label Text='<%# String.Format("{0:f2}", DataBinder.Eval(Container.DataItem,"testfield") %>' ...../>
</ItemTemplate>
</asp:TemplateColumn>


BoundColumn as Currency
DataFormatString="{0:c}"/>

1 ==> $1.00