Posts

String Format for Double C#

String Format for Double [C#] The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString . Digits after decimal point This example formats double to string with fixed number of decimal places . For two decimal places use pattern „ 0.00 “. If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded. [C#] // just two decimal places String .Format( "{0:0.00}" , 123.4567); // "123.46" String .Format( "{0:0.00}" , 123.4); // "123.40" String .Format( "{0:0.00}" , 123.0); // "123.00" Next example formats double to string with floating number of decimal places . E.g. for maximal two decimal places use pattern „ 0.## “. [C#] // max. two decimal places String .Format( "{0:0.##}" , 123.4567); ...

Jquery UI Multiselect bind items from codebehind

you can use : $ ( "#<%=ddlTeste.ClientID%>" ). multiselect ({         checkAllText : "All" ,         uncheckAllText : "Clear" ,     noneSelectedText : "Select a country" ,     selectedText : "# item(s) selected" ,     close : function ( event , ui ) {         var values = $ ( "#<%=ddlTeste.ClientID%>" ). val ();         var array_of_checked_values = $ ( "#<%=ddlTeste.ClientID%>" ). multiselect ( "getChecked" ). map ( function () {             return this . value ;         }). get ();         document . getElementById ( "<%=txtHidDataTeste.ClientID%>" ). value = array_of_checked_values ;     } }); var s = $ ( "#<%=ddlTeste.ClientID%>" ). multiselect (); s . val ([ '1' , '2' , '5' ]); $ ( "#<%=ddlTeste.ClientID%>" ). multiselect ( ...

jQuery UI Multiselect widget clear all check boxes

you can use methiods like Methods After an instance has been initialized, interact with it by calling any of these methods: // example: $("#multiselect").multiselect("method_name"); ...which can be found in the widgets  documentation  under  Methods $ ( "#multiselect" ). multiselect ( "uncheckAll" );

check file exist on Server from SQL Query

use Usage: EXECUTE xp_fileexist <filename> [, <file_exists INT> OUTPUT] OR Create a function like so: CREATE FUNCTION dbo . fn_FileExists (@ path varchar ( 512 )) RETURNS BIT AS BEGIN       DECLARE @ result INT       EXEC master . dbo . xp_fileexist @ path , @ result OUTPUT       RETURN cast (@ result as bit ) END ; GO Edit your table and add a computed column (IsExists BIT). Set the expression to: dbo . fn_FileExists ( filepath )

redirect - go to with javascript

you can use  window . location = url ;

Visual Studio setup project, generate an uninstall .

%windir%\system32\msiexec /x {Product Key}

sql server collation conflict

To resolve the collation conflict add following keywords around "=" operator. SELECT ID FROM ItemsTable INNER JOIN AccountsTable WHERE ItemsTable.Collation1Col COLLATE DATABASE_DEFAULT= AccountsTable.Collation2Col COLLATE DATABASE_DEFAULT Collation can affect following areas: 1) Where clauses 2) Join predicates 3) Functions 4) Databases (e.g. TempDB may be in a different collation database_default than the other databases some times)