views:

32

answers:

1

Hello

I have a problem with my datagridview that is binding to an access table(access 2007), I can retrieve data from the database, but when I wan to store data I cant, even no code is generated, I just want that the user fill some rows in the datagridview and store them in the table of the database, please help me I am new to C# please help me

  private void Form1_Load(object sender, EventArgs e)
    {
        // TODO: This line of code loads data into the 'policiasDataSet.LineaAccion' table. You can move, or remove it, as needed.
        this.lineaAccionTableAdapter.Fill(this.policiasDataSet.LineaAccion);
        // TODO: This line of code loads data into the 'policiasDataSet.Seccion' table. You can move, or remove it, as needed.
        this.seccionTableAdapter.Fill(this.policiasDataSet.Seccion);
        // TODO: This line of code loads data into the 'policiasDataSet.Actividad' table. You can move, or remove it, as needed.
        this.actividadTableAdapter.Fill(this.policiasDataSet.Actividad);
        // TODO: This line of code loads data into the 'policiasDataSet.Proyecto' table. You can move, or remove it, as needed.
        this.proyectoTableAdapter.Fill(this.policiasDataSet.Proyecto);
        // TODO: This line of code loads data into the 'policiasDataSet.ProyectoObjetivo' table. You can move, or remove it, as needed.
        this.proyectoObjetivoTableAdapter.Fill(this.policiasDataSet.ProyectoObjetivo);
        // TODO: This line of code loads data into the 'policiasDataSet.Objetivo' table. You can move, or remove it, as needed.
        this.objetivoTableAdapter.Fill(this.policiasDataSet.Objetivo);
        // TODO: This line of code loads data into the 'policiasDataSet.Municipio' table. You can move, or remove it, as needed.
        this.municipioTableAdapter.Fill(this.policiasDataSet.Municipio);
        // TODO: This line of code loads data into the 'policiasDataSet.Logro' table. You can move, or remove it, as needed.
        this.logroTableAdapter.Fill(this.policiasDataSet.Logro);

    }

    private void fillByToolStripButton_Click(object sender, EventArgs e)
    {
        try
        {
            this.proyectoTableAdapter.FillBy(this.policiasDataSet.Proyecto);
        }
        catch (System.Exception ex)
        {
            System.Windows.Forms.MessageBox.Show(ex.Message);
        }

    }
A: 

It's hard to know what happen if you dont post your source code here. I guess you might want to have a look at OleDBDataAdapter.Update(Datatable table) manual.

Andy
but no code is generated just this:
Natalie
I already edit with the code
Natalie
When you edit your datagridview, you are actually working "offline" data (the datatable retrieved from your query) not the data in the database directly. So I think you need somehow synchronize your datagridview's data source with the database using Update() function.
Andy