How to get last string value

declare @lastString varchar(50);
SELECT @lastString = Field FROM [Table] WHERE Field='2015,1289,613431220'

SELECT SUBSTRING(@lastString , LEN(@lastString) -  CHARINDEX(',',REVERSE(@lastString)) + 2  , LEN(@s)  )

Read More

How to clear Query string value in asp.net

PropertyInfo isreadonly = typeof(System.Collections.Specialized.NameValueCollection).GetProperty("IsReadOnly", BindingFlags.Instance | BindingFlags.NonPublic);
                // make collection editable
                isreadonly.SetValue(this.Request.QueryString, false, null);
                // remove

Read More

Enabling NTLM Authentication (Single Sign-On) in Firefox

This HowTo will describe how to enable NTLM authentication (Single Sign-On) in Firefox.
How many of you have noticed that when you are using Internet Explorer and you browse to your companies intranet page that it will automatically authenticate you but when you use Firefox you will be prompted with a login box?
I recently, in searching for solutions to allow NTLM authentication with Apache, stumbled across how to set a preference in Firefox that will pass the NTLM authentication information to a web server. The preference is network.automatic-ntlm-auth.trusted-uris.
So how do you do it?
1) Open Firefox and type "about:config" in the address bar. (without the quotes of course)
2) In the 'Filter' field type the following "network.automatic-ntlm-auth.trusted-uris"
3) Double click the name of the preference that we just searched for
4) Enter the URLs of the sites you wish to pass NTLM auth info to in the form of:
5) Notice that you can use a comma separated list in this field.
6) Updated: I have created VBScript that can be used to insert this information into a users prefs.js file by using group policy or standalone if for some reason you want to use it for that.

Read More

how to format datetime in gridview for minutes OR Date

<asp:BoundField DataField="HoraAT" HeaderText="Hora" ReadOnly="True" SortExpression="HoraAT" DataFormatString="{0:hh}:{0:mm}" />


<asp:BoundField DataField="CriatedOn" HeaderText="CriatedOn"  DataFormatString="{0:yyyy-MM-dd}"      SortExpression="CriatedOn" Visible="false"/>
Read More

Howe to make random top X rows sql

SELECT TOP [Number]  [Field] FROM [TableName]

Read More
Powered by Blogger