Hi, I am trying to make a query INSERT from C # when I parcer I have a syntax error, but I do not see it. Could someone tell me if I can notice what it is, or what am I doing wrong?
//KyoTest
[HttpPost]
public JsonResult KyoTest(testsoru obj) {
string cs = "Data Source=DMX87025;Initial Catalog=DB_PCC;Integrated Security=True";
//HttpPostedFileWrapper file = test.file; //No es necesario lo pongas en una variable, pero lo pongo para mostrar el tipo de dato
string query = "INSERT INTO Testsoru ([Name],[Wiw],[Formato],[Size],[FName],[Type])" +
" VALUES ( " + obj.name + "," + obj.wiw + "," + obj.formato + "" +
"," + obj.size + "," + obj.fname + ", " + obj.ftype + ")";
System.Console.WriteLine("---------------------------AQUI!!!!!!!----------------------------" + query);
using(SqlConnection con = new SqlConnection(cs)) {
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
return Json(new {
success = true, message = "Success Baby Doll :* ;)"
}, JsonRequestBehavior.AllowGet);
}