Ошибка, показанная при выполнении my ASP.NET применение
Я создал простое приложение insert delete update с помощью asp.net
showwing ошибка как
Incorrect syntax near the keyword 'table'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'table
Что я уже пробовал:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; namespace update { public partial class delete : System.Web.UI.Page { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\rmoorthi\source\repos\update\App_Data\Database1.mdf;Integrated Security=True"); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "insert into table values('"+TextBox1.Text+"','"+TextBox2.Text+"')"; cmd.ExecuteNonQuery(); con.Close(); Response.Redirect("delete.aspx"); } } }