.net 6 core mysql tinyint value 2,3
Add to connection string
TreatTinyAsBoolean=false
To add the `TreatTinyAsBoolean` option to the connection string in MySQL, you typically include it as a parameter within the connection string. Here's how you can do it:
```csharp
string connectionString = "Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;TreatTinyAsBoolean=true;";
```
Replace `myServerAddress`, `myDataBase`, `myUsername`, and `myPassword` with the appropriate values for your MySQL server configuration.
Make sure to set `TreatTinyAsBoolean` to `true` or `false` based on your requirements. Setting it to `true` will treat `TINYINT(1)` columns as boolean values (`true` for 1 and `false` for 0). If set to `false`, `TINYINT(1)` columns will be treated as integers.
留言
張貼留言