Filling a DataTable in C# using MySQL

前端 未结 5 1972
陌清茗
陌清茗 2021-01-07 14:33

I\'m attempting to fill a DataTable with results pulled from a MySQL database, however the DataTable, although it is initialised, doesn\'t populate. I wanted to use this Dat

5条回答
  •  既然无缘
    2021-01-07 14:54

    Here the following why the codes would not work.

    1. Connection
      The connection of your mySQL is invalid
    2. Query
      I guess do you want to search in the table, try this query

    string query = "SELECT * FROM characters WHERE _SteamName LIKE '" + loginName + "%'";

    notice the LIKE and % this could help to list all the data.
    for more details String Comparison Functions

提交回复
热议问题