https://javarevisited.blogspot.com/2018/09/10-devops-courses-for-experienced-java-developers.html#axzz8EC2suLTt
Saturday, 23 September 2023
Thursday, 21 September 2023
Convert table into typescript model
declare @TableName sysname = '[tbl_AppsInfo]'
declare @Result varchar(max) = 'export class ' + @TableName + '{'
select @Result = @Result + '
' + ColumnName + '! :' +ColumnType + ' ;'
from( select
replace(col.name, ' ', '_') ColumnName,
column_id ColumnId,
case typ.name
when 'bigint' then 'number'
when 'binary' then 'boolean'
when 'bit' then 'boolean'
when 'char' then 'string'
when 'date' then 'Date'
when 'datetime' then 'Date'
when 'datetime2' then 'Date'
when 'datetimeoffset' then 'Date'
when 'decimal' then 'number'
when 'float' then 'number'
when 'image' then 'string'
when 'int' then 'number'
when 'money' then 'number'
when 'nchar' then 'string'
when 'ntext' then 'string'
when 'numeric' then 'number'
when 'nvarchar' then 'string'
when 'real' then 'number'
when 'smalldatetime' then 'Date'
when 'smallint' then 'number'
when 'smallmoney' then 'number'
when 'text' then 'string'
when 'time' then 'TimeSpan'
when 'timestamp' then 'long'
when 'tinyint' then 'byte'
when 'uniqueidentifier' then 'Guid'
when 'varbinary' then 'byte[]'
when 'varchar' then 'string'
else 'UNKNOWN_' + typ.name
end ColumnType,
case
when col.is_nullable = 1 and typ.name in ('bigint', 'bit', 'date', 'datetime', 'datetime2', 'datetimeoffset', 'decimal', 'float', 'int', 'money', 'numeric', 'real', 'smalldatetime', 'smallint', 'smallmoney', 'time', 'tinyint', 'uniqueidentifier')
then '?'
else ''
end NullableSign
from sys.columns col
join sys.types typ on
col.system_type_id = typ.system_type_id AND col.user_type_id = typ.user_type_id
where object_id = object_id(@TableName)
) t
order by ColumnId
set @Result = @Result + '}'
print @Result
Tuesday, 19 September 2023
SQL server get latest excuted querires list
SELECT deqs.last_execution_time AS [Time], dest.text AS [Query], dest.*
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
WHERE dest.dbid = DB_ID('dbname')
ORDER BY deqs.last_execution_time DESC
Wednesday, 13 September 2023
Dapper Use cases
var sql = "select * from products";
var products = new List<Product>();
using (var connection = new SqlConnection(connString))
{
connection.Open();
using (var command = new SqlCommand(sql, connection))
{
using (var reader = command.ExecuteReader())
{
var product = new Product
{
ProductId = reader.GetInt32(reader.GetOrdinal("ProductId")),
ProductName = reader.GetString(reader.GetOrdinal("ProductName")),
SupplierId = reader.GetInt32(reader.GetOrdinal("SupplierId")),
CategoryId = reader.GetInt32(reader.GetOrdinal("CategoryId")),
QuantityPerUnit = reader.GetString(reader.GetOrdinal("QuantityPerUnit")),
UnitPrice = reader.GetDecimal(reader.GetOrdinal("UnitPrice")),
UnitsInStock = reader.GetInt16(reader.GetOrdinal("UnitsInStock")),
UnitsOnOrder = reader.GetInt16(reader.GetOrdinal("UnitsOnOrder")),
ReorderLevel = reader.GetInt16(reader.GetOrdinal("ReorderLevel")),
Discontinued = reader.GetBoolean(reader.GetOrdinal("Discontinued")),
DiscontinuedDate = reader.GetDateTime(reader.GetOrdinal("DiscontinuedDate"))
};
products.Add(product);
}
}
}
products = connection.Query<Product>(sql).ToList();
using(var connection = new SqlConnection(connectionString))
{
// Execute the stored procedure
var result = connection.Query<Customer>(
"MyStoredProcedure",
commandType: CommandType.StoredProcedure
).ToList();
}
Thursday, 7 September 2023
How to connect android to mobile phone
1.In mobile goto settings click on about phone.
2. Then select About Phone option and tap on MIUI version several times.
3After a few taps you will gain Developer permissions
4.Now choose Additional Settings and Developer options
5.now in android studio click on pair device
- In your smartphone (Go to Settings->Developer options-> Wireless Debugging->Pair device with pairing code).
- Copy the ipaddress & port. For example: 192.168.1.2:42123 and wifi pairing code: 234321.
- Open your terminal and go to the following path: cd %LOCALAPPDATA%/Android/sdk/platform-tools
- Paste the following command following this order: adb pair (ipaddress & port that you saw when you clicked on "Pair device with pairing code") abd pair 192.168.1.2:42123
- Paste the access code to the wifi connection. Enter pairing code: 41107.
- check in phone the port number write the following command: adb connect 192.168.1.2:41107
If you see a message like this in your mobile "connected to 192.168.1.2:41107", you did it you will be able to connect your phone with android studio without any problem.
to install apk in mobile follow few setting in mobile
c#
https://github.com/dcyuksel/Result
-
Points 1.complex page layouts and adherence to code standards. 2.primeNG pagination 3.ngcontent 4.ngdestory(memorylekage) 5.datatransfer wi...
-
Check duplicate count based on 3 columns combo select EMPID,FORMinfoID,FormName,Count(*) as counts from tbl_FilesMigrationLogs group by Em...