Posts

Donate

How To Setup Or Configure Row-Level Security (RLS) In Power BI Using Domain Credentials

Image
Good Evening All! While I was creating a Power BI report last year,I was tasked to make a report restrict information for a given set of users in our organization. After googling for a few minutes or so, most of the results were pointing me to Row-Level Security. One of the few points mentioned by Microsoft's RLS documentation is that members of a workspace defined in the Power BI service have access to the datasets. In which case are the admins of the workspace. In this report project we have to restrict data through domain account emails. So to start setting up RLS, I need to tweak some settings for both Power BI Desktop and Power BI Service. I. Power BI Desktop 1. In my sample report, click on Modelling menu then choose Manage Roles. 2. Add New Role called Supervisor Information then click Create. 3. Select Supervisor Information Dataset that contains email or information that will be used to Filter data based on a current role. In this case, I chose the Supervisor Informati

WPF MVVM - No connection string named 'MyEntities' could be found in the application config file.

Image
Hello Team, While working on a simple WPF MVVM application using Entity Framework 6.x and Visual Studio 2019, I encountered this strange error No connection string named 'MyEntities' could be found in the application config file . However, if I compile and debug my application, it would proceed with running the project. I've searched lots of information and most of the solutions presented were to copy the web.config or app.config file from a class library to the project that is set as the startup application. One thing I've noticed though is that this error appears only on the XAML page of where the DataContext is assigned. After doing some experiments of modifying my application, I came up with a solution that is instead of setting the DataContext in the XAML like below: <Window.DataContext> <viewModel:StudentViewModel/> </Window.DataContext> I assigned the DataContext in the code behind of the MainWindow and thus the error message disappeared.

RepoDB Error - There is no database setting mapping found for 'System.Data.SqlClient.SqlConnection'

Good day! When I was working with RepoDB ORM I encountered this error {"There is no database setting mapping found for 'System.Data.SqlClient.SqlConnection'. Make sure to install the correct extension library and call the bootstrapper method. You can also visit the library's installation page (http://repodb.net/tutorials/installation)."}. I may have skipped a step in the docs or basically used the wrong RepoDB package for my app. So to fix the issue I made sure that the package I installed was the RepoDB.SQLServer Nuget package and call the SqlServerBootstrap.Initialize() method in my application. In ASP.NET MVC, I added this code in Global.asax.cs Application_Start() method. protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); RepoDb.SqlServerBootstrap.Initialize(); } In WPF, I added the one liner code in the MainWindow's constructor method. public MainWindow() { InitializeCompo

WPF CRUD With DataGrid, RepoDB ORM And C#.NET

Image
Good day Gents, Here's a basic tutorial on how to integrate the RepoDB ORM into your WPF desktop application. I already have written an article in ASP.NET MVC web application here using the said ORM and I realized that I have to create an example for the desktop as well. To proceed working with the code, you need to run the create table script from this post WPF CRUD With DataGrid, Entity Framework And C#.NET . Next is to add a model class that maps the information from the database table to an object or list of objects. public class Students { public int ID { get ; set ; } public string Name { get ; set ; } public int Age { get ; set ; } public string Address { get ; set ; } public string Contact { get ; set ; } public Students() { ID = 0; Name = string .Empty; Age = 0; Address = string .Empty; Contact = string .Empty; } } Add an interface to the project that has the method signatures used in the actual repository class. The interface meth

Visual Studio Error - Unfortunately, a process used by Visual Studio has encountered an unrecoverable error

Image
Two days ago, my Visual 2017 Professional IDE was acting weirdly because of this error " Unfortunately, a process used by Visual Studio has encountered an unrecoverable error. We recommend saving your work, and then closing and restarting Visual Studio ". This error only shows up to a specific ASP.NET MVC project with multiple class libraries and NuGet packages. Other projects opened does not show this exception. As of this posting, my Visual 2017 IDE has been updated to the latest version which is 15.9.30 without any 3rd Party Plugins. Doing some research on the forums led me to different solutions offered like uninstall/re-install the Visual Studio IDE or delete the Newtonsoft.Json Version 9.0.0.0 located in C:\Windows\assembly\GAC_MSIL . The latter solution is not applicable since our Newtonsoft.Json version is 6.0.0. The solution that worked for me is the classic Windows band-aid fix that is to delete files located in temp folders on windows and ASP.NET. Here's wh

Upload Photos Or Files To Google Photos Using Google Photos API, REST And C#.NET

Image
Good morning! I wrote a console application before Read Files From Google Photos Using Google Photos API, REST And C#.NET that reads media items from Google Photos using Google Photos API, C# And REST. That console application was the foundation to one of my project using real world client API. However, that project is limited to only read files and does not have the upload capabilities. Now that I'm free with the projects at work, it's time to revisit the Google Photos API and create a simple console application that will upload photos/images or files to Google Photos using REST, Google Photos API and C#. So to get started, make sure you have read the documentation to setup the API here Get started with REST . Once you have successfully setup the API, download the JSON file that contains your credentials specifically Client Secret and Client ID and add that file to your console app project. Make sure to set the Copy to Output Directory of the JSON file to Copy always i

Visual Studio Nuget Package Restore Error - The type or namespace name 'Xamarin' could not be found

Image
Good evening, Recently, I encountered an error called "The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)" when running my simple Xamarin Forms application in Visual Studio 2019 which is the output of the training I attended with. It seems that the project is missing some references and when running the solution, the project was unable to download the missing assemblies. After investigating the problem, I found the culprit. Our custom Nuget packages were located in a server which has been turned off due to system upgrades and these files will be moved to a new location. So to fix the issue I had to perform the steps below: 1. Temporarily unchecked our custom built packages in Package Sources of Package Manager Settings since our server that contains those packages was turned off for system maintenance and the projects including the packages will be moved to a new location. 2. Run the command &q

ASP.NET MVC Web Application CRUD Using RepoDB ORM

Image
Happy Sunday Awesome Programmers! See the ASP.NET Core MVC version of this tutorial here Create An ASP.NET Core MVC CRUD Website Using RepoDB ORM And SQL Server A week ago, I received a newsletter regarding a promising ORM called RepoDB. This ORM library is created by Michael Pendon who is an application architect in Europe. According to him, RepoDB is an open-source . NET ORM library that bridges the gaps of micro-ORMs and full-ORMs. It helps you simplify the switch-over of when to use the BASIC and ADVANCE operations during the development. It is your best alternative ORM to both Dapper and EntityFramework . It also provides query support to several databases such as MySQL, SQL Server, PostGreSQL and there's a survey that this ORM's performance is faster than Dapper. I've used Dapper before and Entity framework in my ASP.NET MVC applications so, it's time to try using this tool by creating a simple ASP.NET MVC CRUD Application(Create, Read, Update, Delete) Applic

ASP.NET MVC Bind Or Populate jsTree From SQL Server Database

Image
Hello Everyone, Normally when working with real world information, we tend to have projects or tasks that will show employees with their supervisors or managers viewed in hierarchical structure. If the given project is a web application, the jsTree.js fits for this requirement. This article will show you how to populate a jsTree from SQL Server database table called ContosoRetailsDW which is a Microsoft sample database. It already has a table specifically DimEmployee that we can play with. To begin with lets define the models used. The JsTreeModel class contains the information used by the jsTree while the clsResourceManagers class receives the result from the query. public class EmpManagerTreeViewModel { public clsResourceManagers ResourceManager { get ; set ; } public JsTreeModel EmployeeTreeModel { get ; set ; } public EmpManagerTreeViewModel() { ResourceManager = new clsResourceManagers(); EmployeeTreeModel = new JsTreeModel(); } } public class clsRes

Donate