string name = TextBox2.Text;
string place = TextBox3.Text;
string roll = TextBox4.Text;
string country = TextBox5.Text;
string str = "INSERT INTO Table( 网站名,网址,排名,国家 ) VALUES ('" + name + "," + place + "," + roll + "," + country + "')"; //INSERT INTO Websites(name, url, alexa, country) VALUES('百度', 'https://www.baidu.com/', '4', 'CN');
string sql = "Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=C:\\Users\\wyb\\OneDrive\\ASP\\WebApplication2\\数据库\\新建数据库.mdf;Integrated Security=True;Connect Timeout=30";
SqlConnection con = new SqlConnection(sql);
con.Open();
SqlCommand sqlopen = new SqlCommand(str, con);
sqlopen.ExecuteNonQuery();
con.Close();
报错是关键字Table附近语法不正确,我的sql数据表叫Table