Quote of the Day

more Quotes

Categories

Buy me a coffee

Web scraping in C# using HtmlAgilityPack

Published October 16, 2022 in .NET , .NET core , C# - 0 Comments

In this post, I show an example of scraping data in C# using HtmlAgilityPack. I come across HtmlAgilityPack because I need to get data from Zillow to analyze properties deals. I was able to scrape the data I want without much trouble using HtmlAgilityPack with a bit of XPath, LINQ and regular expression.

Continue reading

Easily test sending and receiving email locally using MailHog

Published September 23, 2022 in Java , Testing - 0 Comments

A java application which I work on has a feature to send emails via the corporate SMTP server to notify certain personnel whenever an error occurs. For security reasons, only servers within a certain networks can access the SMTP server and send emails. For instance, the computer which I use to build the application does not have access to the SMTP server. When searching for an email testing tool, I stumbled upon MailHog. Within minutes, I was able to run MailHog and test sending emails without having to deploy the app to the remote servers.

Continue reading

Building multitenant application – Part 3: Authentication

Published August 20, 2022 in Azure , Azure Active Directory - 0 Comments

In this post, I continue to share what I have learned while building a multitenant application by ultilizing Microsoft Identity Framework and SQL role level security. Specifically, I share what I have learned following Microsoft example project and documentations to make authentication works in a multitenant environment.

Continue reading

Building multitenant application – Part 2: Storing value into database session context from ASP.NET core web API

Published August 13, 2022 in .NET , .NET core , ASP.NET core , Azure SQL database - 0 Comments

In the previous post about row level security in SQL server, I gave an example of reading a value from the database session context to feed into the security function for filtering data. In this post, I show examples of calling the sp_set_session_context store procedure from an ASP.NET core web API to store a value into the session context.

Continue reading

Building multitenant application – Part 1: Multitenant database using Row Level Security

In this and upcoming posts, I’ll be sharing what I have learned while implementing a multi-tenant solution. Specifically, in this post, I share my understanding about Row Level Security in SQL server, and how I have utilized it to host data for multiple organizations in a way that is transparent to the users.

Continue reading

Migrating from Oracle to Azure SQL caveat – prepared statement set string causes implicit conversion

Published June 1, 2022 in Azure , Azure SQL database - 0 Comments

In the previous post, I discuss the issue we face with storing date and time after migrating to azure SQL and the solution. If interested, you can check it out here. In this post, I talk about an issue we encountered with regards to implicit conversion, causing high CPU usage and performance degradation.

Continue reading

Migrating from Oracle to Azure SQL caveat – java.sql.Date does not represent time.

My team recently migrated one of our main database from Oracle to Azure SQL database. In this and upcoming posts, I’m going to share a few things I have learned during the process. Specifically, in this post, I share an issue we ran into with storing date and time, after migrating the schema and data from our Oracle into azure SQL database.

Continue reading