Since installing visual studio 2017 I do not update the data in the database with linq. check the code many times and it's all good, it's more from other projects I also stop updating. I think it's a problem of the LinQ class but the point is that I can not update anything. With try and catch, I'm not mistaken. I do not know what to do, I'm half desperate. Use Visual Studio 2017 with SQL SQLSERVER 2017
It's an example that I created to show the problem. But I already tried other projects that worked perfectly but now they do not work for me
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
DataClasses1DataContext db = new DataClasses1DataContext();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
afiliados af = db.afiliados.Where(x => x.DNI ==
"26954776").Single();
af.ASAMBLEA = 1;
af.VOTO = 1;
af.TELEFONO_SOCIO = 111;
db.SubmitChanges();
}
catch (Exception )
{
MessageBox.Show("problema");
throw;
}
}
}
}
Then I execute the query in the SQLServer 2016 and it does not modify.
select * from afiliados where dni = '26954776'
shows the unmodified data as result
that is, the fields ASSEMBLY, VOTE, TELEPHONE_SOCIO are not modified. Now install and uninstall the visual studio and the SQLServer and nothing remains the same. Will it be that with VS2017 I change the way I work with linqtosql? If you can help me, please. THANK YOU !!!!!