Entity Framework Cyrillic displayed as question marks - c#

I am writing an application and I am using Entity Framework and MSSQL. I have some cyrillic data(Bulgarian, if that matters) in the database. Problem is when I try to read it from the program I get question marks(?????????) but when I try from SQL Management studio everything shows up fine. Collation is set to Cyrillic_General_CI_AS and I am using nvarchar for the columns I store cyrillic characters in. I need your help. How can I fix this?

I found the solution. It turns out that the data that comes out of the database is perfectly fine. The problem was in the displaying. I was using a console project for testing and it apparently didn't like the cyrillic font. Changing the font of the console fixed my problem.

Related

How to change encoding in .net maui?

I'm trying to write an app by using .net maui.
When I use Ukrainian letters I get an error.
As far as I understand, this problem can be solved by changing encoding, but I don't know how to do this correctly.
I'm trying to change encoding to windows1251 in appshell, but it wasn't successful. Maybe I forgot something.

Xamarin ignoring my accents

I'm building and iOS App using Xamarin Studio and having some problems with the accents. Seems that the file enconde is wrong or something like that, but I can't find where/how to fix it.
For example, assuming that label is an outlet to a UILabel on my storyboard:
label.Title = "Álbum";
is showing "Album" without the accent on the interface.
If I try to do an Insert into a SQLite database like this:
connection.ExecuteScalar<EventData>("Insert Into EventData (Id, Description, Kind) values ('1', 'Mamãe chegando.', 0)");
I get an error in the SQL. But the same SQL when used on a sqlite console runs without a problem.
And when I run this SQL without the "ã", works even on the Xamarin.
Any idea how to fix it?

C# and Crystal Reports SDK - Selection Criteria Ignored

I have a crystal reports rpt file being called from C# code. Report works as expected from Designer within Studio 2010. Same report ignores Selection Criteria when called from C#, but ONLY when including a certain table's field in the criteria.
Current Criteria Example :
date({transaction.transaction_date}) in {?FromTo} and
{user_branch.branch_id} = 1
{?FromTo} is a date range parameter which works perfectly
When I remove the branch_id section, the {?FromTo} date parameter is checked correctly and the data returns as expected. BUT, as soon as I include the branch_id field, ALL the data is returned, which does not make sense at all.
Running this exact same report via the designer, works correctly... The problem occurs when running via C# SDK code.
Any help with this will be GREATLY appreciated
Already Tried
Recreate Entire Report from Scratch bit by bit, table by table. This works up to a point where I start adding more fields to the report itself, no one in particular, then the problem starts up again... So obviously, I start back tracing my steps until the entire report is empty again, but the problem persists, like the file is now "broken"
No similar issues in google... No where in my code is a line emptying the selection criteria during code... My other reports not accessing that table works fine.
Currently using version 13.0.1 of the CR Runtime. Tried to upgrade to 13.0.2, still didn't work
Ran the exact same SQL that the report generated directly against the database. That works as expected.
Try changing your criteria to:
(date({transaction.transaction_date}) in {?FromTo}) and
{user_branch.branch_id} = 1
Adding the date({transaction.transaction_date}) in {?FromTo} line inside a (). I'm not just sure.
After many head-aches this week, I finally found the problem... This looks like a bug in the SDK itself though, but to solve the problem, just make sure that the field giving the problem mentioned above is contained in the detail section of the report.
i.e. I added my branch_id field to the detail section of the report and suppressed it. It works by suppressing the section as well, just as long as the field is contained there.
I tested this on all my other reports with the same problem and it worked.

Problem with posting values from ASP.NET to mysql

I'm developing a web site with mysql backend and I have the following problem. The site has a Search page that takes parameters in TextBoxes. When I'm posting the form and building the criteria from the values mysql doesn't return anything when I use greek characters. When I'm using Mysql Query Browser the same query works fine. I've set globalization in web.config and have everything in utf-8 encoding. Please Help.
I had a similar problem in PHP recently and had to run some SQL before each query along the lines of:
SET NAMES 'utf8'
Or:
SET CHARACTER SET utf8
Might be worth giving this a try? Hopefully it will help.

C# dataset insert query issue from access database

I'm using Visual Studio 2008 and an Access 2007 database.
While I'm trying to create a new insert query in my DataSet, the insert stored procedure mixes up the database field values.
I have a print screen of the problem here: http://netplague.eu/Capture.PNG
As you can see in the attached print screen the table clients is displayed and below the InsertClient stored procedure. My problem is that the parameters are all mixed up.
Is there a solution to this problem or is it just a visual studio bug?
Thank you.
It's probably just a display order issue.
If you are inserting the parameters in alphabetical order of the field names, but Visual Studio is displaying the fields in the order they are defined in the database (for example), this would explain the difference.
I had your same problem. I have fixed it installing the service pack 1 for Microsoft visual studio 2008. I hope this help.
Simone

Categories