Skip to content

Inserting Chinese characters are messy code #764

Open
@xlp100

Description

@xlp100

There will be problems with the following code:

string utf8String = @"INSERT INTO pstate(id, name, remark) VALUES(233, '中文', NULL);";
cmd.Execute(utf8String);

but it is ok:

string utf8String = @"INSERT INTO pstate(id, name, remark) VALUES(233, ?, NULL);";
cmd.Execute(utf8String,'中文');

What is the difference between the two?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions