帮助更新我的datagridview按钮的代码 [英] Help to update my code for datagridview Buttons

查看:81
本文介绍了帮助更新我的datagridview按钮的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datagridview表来更新我的数据库.Below是我写的初始代码,但现在我不知道如何编码保存,删除,下一个,上一个,最后一个,新的和刷新按钮。请让我以下是我的代码。谢谢







I have a datagridview table to update my database .Below is the initial code i have write but now i have no idea that how to code for save,delete,next,previous,last,new and refresh buttons.Please let me guide by any experience person.My Code is given below.Thanks



Imports System.Data.OleDb
Public Class Form1
    

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\EmplTable.accdb;")
        Dim cmd As OleDbCommand = New OleDbCommand("SELECT *  FROM EmpData", con)

        con.Open()



        Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmd)
        Dim myDataSet As DataSet = New DataSet()
        myDA.Fill(myDataSet, "EmpData")



        DataGridView1.DataSource = myDataSet.Tables("EmpData").DefaultView


        con.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        


    End Sub






End Class

推荐答案

有很多例子。以下是其中几个。



1. 使用c#在datagridview中插入更新删除编辑 [ ^ ]

2. 在DataGridView中使用C#中的DataTable插入,删除,更新 [ ^ ]

3. 插入,使用WCF服务在Windows窗体中使用DataGridView更新和删除数据 [ ^ ]
There are many examples. Below are few of them.

1. insert update delete edit in datagridview using c#[^]
2. Insert, Delete, Update in DataGridView with DataTable in C#[^]
3. Insert, Update and Delete Data With DataGridView in Windows Form Using WCF Service[^]


这篇关于帮助更新我的datagridview按钮的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆