VRose
VRose
CC#
Created by VRose on 10/15/2024 in #help
Force Clickonce to use a specific port?
How can I force a clickonce setup and the update mechanism to use a specific port? including the initial connection
1 replies
CC#
Created by VRose on 6/8/2024 in #help
How does tokenization work to protect sensitive data?
So tokenization is basically taking an input for let's say an id 123-456-789, store the real id in database1 then tokenize the id into a systematic id like 000-000-001 then store the token into database2? But how are the data even getting secured if the original data still exists as its in database1?
7 replies
CC#
Created by VRose on 5/19/2024 in #help
Modifying the hosts file through c# code
I've been trying to modify the hosts file in Windows using C# .NET windows desktop app, but no matter what I try, I always get the error Access denied even though I do run my code as admin. I've tried : 1. manually opening the hosts file and writing to it 2. running a cmd script as admin (that usually works when manually ran) but it didnt work when I called it from my code 3. running a ps script (that also works when ran manually) but didn't work when ran inside my c# code. So how can I do this..? Seems like I just can't modify the hosts file at all in C# even with admin privileges
6 replies
CC#
Created by VRose on 1/8/2024 in #help
ASP.NET Core Blazor + EF error
I'm programming an ASP.NET Core Blazor and I'm using Entity Framework to contact the database. Everything works fine except when I use an async function which queries the database. I get the following error:
General error: Invalid operation. The connection is closed.
General error: Invalid operation. The connection is closed.
Although I've set the Microsoft SQL Server connection timeout to none yet this still happens
var department = await PrrojectDBService.GetDepartmentByIdWithRelatedData(selectedDepartmentID);
var department = await PrrojectDBService.GetDepartmentByIdWithRelatedData(selectedDepartmentID);
and here's the code for that function:
public async Task<Project.Models.ProjectDB.Department> GetDepartmentByIdWithRelatedData(int departmentId)
{
try
{
Console.WriteLine("Starting to fetch department data for department ID: " + departmentId);

var department = await Context.Departments
.Include(d => d.DepartmentNotes)
.Include(d => d.DepartmentInfrastructures)
.Include(d => d.DeviceInstallationStatuses)
.FirstOrDefaultAsync(d => d.departmentID == departmentId);

Console.WriteLine("Successfully retrieved department data for department ID: " + departmentId);

return department;
}
catch (DbException dbEx)
{
Console.WriteLine("Database-related error: " + dbEx.Message);
throw;

}
catch (Exception ex)
{
Console.WriteLine("General error: " + ex.Message);
throw;
}
}
public async Task<Project.Models.ProjectDB.Department> GetDepartmentByIdWithRelatedData(int departmentId)
{
try
{
Console.WriteLine("Starting to fetch department data for department ID: " + departmentId);

var department = await Context.Departments
.Include(d => d.DepartmentNotes)
.Include(d => d.DepartmentInfrastructures)
.Include(d => d.DeviceInstallationStatuses)
.FirstOrDefaultAsync(d => d.departmentID == departmentId);

Console.WriteLine("Successfully retrieved department data for department ID: " + departmentId);

return department;
}
catch (DbException dbEx)
{
Console.WriteLine("Database-related error: " + dbEx.Message);
throw;

}
catch (Exception ex)
{
Console.WriteLine("General error: " + ex.Message);
throw;
}
}
78 replies
CC#
Created by VRose on 6/11/2023 in #help
❔ Filling RDLC report table with a custom SQL query.
How can I fill an RDLC report table from a custom sql query that gets data from several tables? I tried making a dataset but the RDLC report only takes a datasource from one table. So how can I get around thisissue?
2 replies
CC#
Created by VRose on 4/6/2023 in #help
❔ Scanning documents in a scanner using ADF mode
I've tried to use WIA to scan multiple papers that's fed into the scanner in the flatbed but I always face errors. May someone please tell me how am I supposed to do this correctly?
10 replies
CC#
Created by VRose on 3/16/2023 in #help
❔ Storing & retrieving face encodings to compare
What's the best way to store face encodings (an array of size 128 and type float64) in a database and then retrieve it? I tried encoding it to a BLOB but then when I use
Select id from users where faceEncoding = @encoding
Select id from users where faceEncoding = @encoding
but it still doesn't return anything although I'm getting the face encoding of the same person that's registered in the SQL database
2 replies
CC#
Created by VRose on 3/13/2023 in #help
✅ Installing Emgu CV
50 replies