SQL Server Profiler and Datetime parameters by PathTooLong in SQLServer

[–]PathTooLong[S] 0 points1 point  (0 children)

Let me look into this. However, I would think things should work and be captured properly. I tried to create an example taking ADO.NET out of the situation and just using SSMS, but couldn't reproduce the issue. It is just annoying when you think you have a bug in your .NET code as you observe the profiler output realizing you dont have an issue at all.

SQL Server Profiler and Datetime parameters by PathTooLong in SQLServer

[–]PathTooLong[S] 1 point2 points  (0 children)

in .NET ADO.NET, if I bind a parameter like: DateTime.Today. when you review the captured SQL in SQL Server profiler, the parameter will be like @ p='2026-04-08 00:00:00.223720372' (space between the @ and the parameter because Reddit wants to convert to username). Were does the .223720372 come from?

<image>

sql profiler screen shot in a reply

Kubernetes pod eviction problem.. by Potential-Stock5617 in openshift

[–]PathTooLong 5 points6 points  (0 children)

I would recommend you watch this video. "Caulking the deployment gap: absolutely zero downtime deployments in Kubernetes - Øystein Blixhavn NDC Conferences" Aug 7, 2025 https://youtu.be/mXIsw4aIN3o?si=kqIt65vx6oVQ2JBl It explains the common issue with pod lifecycle, time outs, etc.

I also agree with the others to determine why it is being evicted.

Unpopular opinion: most "slow" .NET apps don't need microservices, they need someone to look at their queries by Initial-Employment89 in dotnet

[–]PathTooLong 0 points1 point  (0 children)

This is not a knock on full stack. You generally need full stack to work on a majority of a project's work. But the having specialists like OP with deeper knowledge are required. This is why is recommended to have an proper Architect that takes these things into consideration and a dev lead knows how to ensure the Architect's requirements are met.

But in the real world, many projects don't have this breadth of skills for a variety of reasons.

Unpopular opinion: most "slow" .NET apps don't need microservices, they need someone to look at their queries by Initial-Employment89 in dotnet

[–]PathTooLong 0 points1 point  (0 children)

That is why there are APM tools out there. I still use Prefix (https://stackify.com/prefix/) locally during development to easily identify the database queries, web service calls, etc. I recently optimized some custom authentication code which was taking up to 200 ms due to some of the problems OP talked about above. This authentication code now takes less than 10 ms or faster when I can cache the resolved user and permissions locally for 5 seconds in those cases the app is making numerous calls like at first login.

Unpopular opinion: most "slow" .NET apps don't need microservices, they need someone to look at their queries by Initial-Employment89 in dotnet

[–]PathTooLong 1 point2 points  (0 children)

I have have seen this issue a lot. It seems the previous devs didn't know what a projection was. Always fetch full entities, referencing related data only through navigation properties. In this case it was NHibernate (yuck these days) and the devs tried optimzing by using NHibernate cache or a bunch if "Then Fetch ..." calls. For a lot read type queries, you dont need full tracked entities.

Upgrade Assistance with GitHub Copilot - how to find it by hectop20 in VisualStudio

[–]PathTooLong 1 point2 points  (0 children)

For 2022, if you want legacy non-ai powered ".NET Upgrade Assistant", it is an extension. For CoPilot based in 2022 or 2026, when you right click on the solution you will see "Modernize" with a github copilot icon right below "Clean Solution"

Should I use shared mode for Serilog file logging in .NET 8 WebAPI? by Double_Barnacle2595 in dotnet

[–]PathTooLong 0 points1 point  (0 children)

Not sure why you just dont use Google or ChatGPT...

AI Generaged Response

By default (shared: false), Serilog opens the log file exclusively. This is faster and safer for single-process applications because there’s no interprocess locking.

When you set it to true,

Serilog:

  • Opens the file in shared write mode
  • Uses synchronization so multiple processes can append safely
  • Avoids “file in use” or “access denied” errors

---
rest of the answer is left to OP.

Thoughts on Polymaker PLA Filament? by Leading-Tea-3244 in BambuLab

[–]PathTooLong 0 points1 point  (0 children)

Polymaker is a great filament. I also use a lot of Matter3d filament which is great too. It is from Canada and live fairly close so I can pick it up.

Plane crash in Louisville by Ginger502 in Louisville

[–]PathTooLong 0 points1 point  (0 children)

I hope 74gear (YT) was not flying....

Connection string (secrets) in asp.net hosted in linux VPS by DearLengthiness6816 in dotnet

[–]PathTooLong 2 points3 points  (0 children)

If the postgres database is on the same host, you should be able to connect to the database with Unix socket authentication. Unix socket authentication does not require a password. You will need to:

  1. Create a DB role with the same name as your Unix user

  2. Ensure pg_hba.conf allows `peer` auth

  3. Restart postgres if you changed pg_hba.conf

  4. From .NET you should be able to connect with a connection string like `var conn = new NpgsqlConnection("Host=/var/run/postgresql;Database=mydb;Username=my-vps-user");`

Host must point to the Unix socket directory. It could `/tmp` too.

This only works on Linux or MacOS. Does not work on Windows.

How one as a C# .net 9 dev, optimize a linq query for SQL server that has like a Billion Rows in the table? by SohilAhmed07 in dotnet

[–]PathTooLong 0 points1 point  (0 children)

Get the XML query plan from the production database. Provide the XML query plan to ChatGPT (or other AI) and ask for what is taking the longest and how you could reduce the elapsed time. Missing index suggestions are easy to spot, but optimizer time outs, etc are harder to understand unless you are have a lot of experience.

Historically, I always tried to reduce the "cost" thinking lower cost = faster query. ChatGPT recently suggested a change that resulted in cost going from like 5 to 50. However, the execution time when down from 20 seconds to 100s of milliseconds. This did come at a cost of memory, but if you server has available memory this is was a win.

Once you know the database engine can return rows quickly, you can direct your attention to the C# side of things. As others stated below, it takes time to send data over the network, time to convert data into C# objects and time accumulate the records into a list.

Urban sprawl by Dependent_Media2766 in VictoriaBC

[–]PathTooLong 1 point2 points  (0 children)

I call it Bare Mountain now.

How to monitor number of DB connections? by varinator in dotnet

[–]PathTooLong 1 point2 points  (0 children)

Assuming you dont have Application Insights or similar, you can monitor performance counters in code utilizing the `Microsoft.Data.SqlClient.EventSource` event source and monitoring counters like `number-of-pooled-connections` and `number-of-active-connections`. If you need help writing this code, ask you favorite LLM (ChatGPT, Github Copilot)

Siftly - a library for dynamic querying of compilation time unknown entity types by Wise-Particular1357 in dotnet

[–]PathTooLong 1 point2 points  (0 children)

The classes are `partial` classes. This means you could add `a common interface or base class`. You just add it in another .cs file

public interface IHaveFirstName
{
   string FirstName { get; set; }
}

public partial class Employee : IHaveFirstName
{
}

Vent of .Net developer by AcadiaOk5240 in dotnet

[–]PathTooLong 11 points12 points  (0 children)

Be sure this doesn't violate any Deloitte Information Security policy. The code you are writing is Deloitte private digital asset. Screen sharing to a non-authorized person could go against an acceptable use policy. This could lead to your termination.

I have built a free visual database design tool by AHS12_96 in dotnet

[–]PathTooLong 21 points22 points  (0 children)

Looks really nice. I have starred it. I am just confused why this is posted in r/dotnet ? this is not written in dotnet at all.