错误是:
System.Data.dll中发生未处理的"System.Data.SqlClient.SqlException"类型的异常
附加信息:关键字"User"附近的语法不正确.
代码是:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
SqlConnection conn;
SqlDataAdapter GameDA;
SqlDataAdapter DetailDA;
DataSet DetailDS;
SqlCommandBuilder cmdBuilder;
SqlDataAdapter UserDA;
SqlDataAdapter AdministratorDA;
SqlDataAdapter OrderDA;
DataSet OrderDS;
SqlCommandBuilder cmdBuilder2;
public Form1()
{
InitializeComponent();
conn = new SqlConnection("Data Source=HOME-AC284121FE\\SQLEXPRESS;Initial Catalog=GameShop;Integrated Security=SSPI;");
SqlCommand command1 = new SqlCommand("SELECT * FROM Game", conn);
GameDA = new SqlDataAdapter(command1);
SqlCommand command2 = new …Run Code Online (Sandbox Code Playgroud)