开发者

binding to datagridview in C#?

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);
        }

    }


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜