如何使用vb.net在数据库中保存datagridview的头 [英] How to save the header of the datagridview in database using vb.net

查看:197
本文介绍了如何使用vb.net在数据库中保存datagridview的头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想要在数据库中保存datagridview的头。 datagridview的头是我们在文本框中输入的值。我们想要的是将头保存为数据库的字段。有人知道怎么做吗?

We wanted to save the header of a datagridview in the database. The header of the datagridview is the value we inputted in the textbox .What we want is to save the header as the field of our database . Does anyone know how to do it ??thank you

推荐答案

嗯...像这个?

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim fetchDGVHeaders(DataGridView1.ColumnCount) As String
    For a = 0 To DataGridView1.ColumnCount - 1
        fetchDGVHeaders(a) = DataGridView1.Columns(a).Name
        MsgBox(fetchDGVHeaders(a))
    Next
    INSERT_INTO_DB("INSERT INTO DBHeaders(MEaw,MEow,MEow_MEow)VALUES('" & fetchDGVHeaders(0) & "','" & fetchDGVHeaders(1) & "','" & fetchDGVHeaders(2) & "','" & fetchDGVHeaders(3) & "')")
End Sub

$ b b

获取当前的DataGridView标题,然后将其存储到其他表中

Fetch the current DataGridView Headers then store it to other table

这篇关于如何使用vb.net在数据库中保存datagridview的头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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