![](/img/trans.png)
[英]Small problem with hamburger, but I don't see it. Help me to find error please
[英]Please Help Me Out In Finding This 1 small error in the Code
大家好,我需要实验室任务的帮助,我正在研究教授提出的一个小错误,我无法找到它。 该实验室与SQL数据库有关。 错误发生在sql语句中。 请帮我找到它谢谢你。
// Attach connection string to connection object.
con.ConnectionString = conn;
// Attach the connection object to the command object
cmd.Connection = con;
// Build sql string
String sql =
"SELECT " +
"Players.PlayerID, " +
"Players.TeamID, " +
"Players.LName, " +
"Players.FName, " +
"Players.PNumber, " +
"Players.BDate " +
"FROM" +
"Players " +
"ORDER BY " +
"Players.LName Asc, " +
"Players.FName Asc";
// Add sql to command object
cmd.CommandText = sql;
txtPlayers.Text += "***CommandText: " + cmd.CommandText + "\n";
FROM
和Players
之间的字符串中没有空格。
如果您已将生成的SQL打印到屏幕上进行检查,您会发现这更容易发现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.