how to export datas to json file from mysql

I have datas in mysql I want to move them to a json file. How can I do that?
No description
No description
7 Replies
kurumi
kurumi4mo ago
I think you don't even need a C# for this. Is there any MySQL extension that helps writing data into a file? or you can do it manually by using Dapper / EF Core and stringify as JSON into a file
kurumi
kurumi4mo ago
Stack Overflow
How to convert result table to JSON array in MySQL
I'd like to convert result table to JSON array in MySQL using preferably only plain MySQL commands. For example with query SELECT name, phone FROM person; | name | phone | | Jack | 12345 | | John |
only you know
only you know4mo ago
I need to write as a service so I can do it from controller that's my task
kurumi
kurumi4mo ago
I see so as I told, use Dapper or EF Core to get list of your items and then stringify it as json
only you know
only you know4mo ago
can't use both. only ado and linq allowed
Pobiega
Pobiega4mo ago
You should be able to do this by now. Just break it down. Query data from database, save in memory as objects serialize objects to json write to file
only you know
only you know4mo ago
yh I managed to do it. I used DTO and serialized it
Want results from more Discord servers?
Add your server
More Posts
Licensing my programHi, i’m developing a Point Of Sale software and would like to find out possible solutions to manage ✅ Unhandled exception. Cannot print exception string because Exception.ToString() failed.justwhy this error always come in dotnet webapi application version ----- dotnet --version ✅ How to use Dapper with Query ParametersI work a lot with SQL databases such as MySQL, SQLite and PSQL and usually I write my Queries like t✅ transaction in transaction issueI have this error: `The connection is already in a transaction and cannot participate in another trHelp making login function c#Im currently trying to code a login function I have the registration my user is getting saved in thProblems with docker and my app imageI already posted a question that more or less manage to solve but now i have other problem, the thiAttempting to get value from different JSON files with variable keyHello o/ I am attempting to deserilize and obtain the value from a variety of JSON files that contaiHow to display only department fields associated with a selected department in student automationhi, I'm facing a challenge while working on the student automation system. After selecting the deparHelp with DiscordGameSDK in a C# project (no Unity)I am currently trying to develop a plugin for a Unity game. For this I created a C# project, where IMarshal.GetActiveObject("Word.Application") fall in exceptionI'm working on a `.NET Framework` console application, I have added the `Microsoft.Office.Interop.W