New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read some json values, Common Language Runtime detected an invalid program. #4483
Comments
Can you try to use this extension? #1230 (comment) |
|
Суть в том, что мне нужно динамически, из 1000 сохраненных в колонке с json значений прочитать только 5 параметров, заранее не известных. Именно поэтому я пытаюсь использовать этот код const int readColCount = 5;
|
I know, but this is just an example, in fact, my solution should work with various databases, including Sql Server, Postgres, SQLite. If linq2db has uniform support for this, it will be great. |
Addition ` foreach (var col in Enumerable.Range(0, readColCount)) |
Describe your issue
Всем привет!
Пытаюсь прочитать некоторые колонки из строкового поля, содержащего данные сериализованного Dictionary<string, object?>, получаю ошибку
Сгенерированный SQL
-- SqlServer.2012
SELECT
[t1].[Id],
JSON_VALUE(JsonData, '$."0"') AS '0',
JSON_VALUE(JsonData, '$."1"') AS '1',
JSON_VALUE(JsonData, '$."2"') AS '2',
JSON_VALUE(JsonData, '$."3"') AS '3',
JSON_VALUE(JsonData, '$."4"') AS '4'
FROM
[TestJsonWrite] [t1]
Steps to reproduce
Environment details
Linq To DB
version: 5.4.1Database (with version): SQL Server 2019 (e.g. SQL Server 2019)
ADO.NET Provider (with version): Microsoft.Data.SqlClient 5.2.0
Operating system: Windows 10
.NET Version: 6.0
The text was updated successfully, but these errors were encountered: