Skip to main content

Posts

Showing posts from January, 2018

Get C# class declaration from Oracle Table

Select distinct 'public ' || case Lower(DATA_TYPE)              when 'raw' then 'Guid?'              when 'number' then 'Decimal?'             when 'char' then 'string'             when 'date' then 'DateTime?'             when 'decimal' then 'decimal?'             when 'nvarchar' then 'string?'             when 'uniqueidentifier' then 'Guid?'             when 'varchar2' then 'string'             else 'UNKNOWN_' || DATA_TYPE end|| ' '  || replace(initcap(replace(Column_name,'_',' ')),' ','') || ' { get; set; }' ,  all_tab_columns.column_id   from all_tab_columns where table_name= upper('SPA_DISCOUNT_GROUP')   order by all_tab_columns.column_id select *   from all_tab_columns where table_name= upper('SPA_DISCOUNT_GROUP') --------------- Result --------------

Get C# class Declaration from SQL Table structure

Get C# class Declaration from SQL Table structure ------------ CODE ---------- to be executed in SQL --------- declare @TableName sysname = 'Transaction_document' declare @Result varchar ( max ) = 'public class ' + @TableName + ' {' select @Result = @Result + '     public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } ' from (     select          replace ( col . name , ' ' , '_' ) ColumnName ,         column_id ColumnId ,         case typ . name              when 'bigint' then 'long'             when 'binary' then 'byte[]'             when 'bit' then 'bool'             when 'char' then 'string'             when 'date' then 'DateTime'             when 'datetime' then 'DateTime'             when 'datetime2' then &

Load XML data in DataTable and use LINQ on it

XML Document Structure - xml version = " 1.0 " encoding = " utf-8 " standalone = " yes " ?> < Root >   < Type TypeName = " Functions " >     < Details FunctionName = " InActiveUsers_Mail " ClientList = " Etihad,Malasia " />     < Details FunctionName = " UnAssignedUsers_Mail " ClientList = " Etihad,Virgin " />   </ Type >   < Type TypeName = " Mails " >     < Details FunctionName = " InActiveUsers_Mail " ClientList = " Etihad,Malasia " />     < Details FunctionName = " UnAssignedUsers_Mail " ClientList = " Malasia,Virgin " />   </ Type > </ Root > Load XML Document in DataTable - XmlDocument xmlDoc = new XmlDocument (); xmlDoc.Load( Environment .CurrentDirectory + "\\ClientWiseFunctionality.xml" ); XmlNodeList elemList = xmlD
When your keyboard does not display single quotes (') on single click but when it is clicked again displays 2 single quotes ('') , do the following settings Control Panel > Clock, Language and Region > Region and Language > Keyboards and Language. Click the “Change keyboards” button under “Keyboards and other input languages”. Now the chances are you have chosen “US international”. This behaviour is default on this keyboard setup. Click the “Add” button and add “US”. Change to this and remove US international and your keyboard should start working as expected.