如何在引导表中查看mysql中的数据?

mbzjlibv  于 2021-06-15  发布在  Mysql
关注(0)|答案(1)|浏览(328)

实际上,我已经开始使用vb.net和aspx,我会将数据库中的数据添加到引导表中,实际上这是一个静态表的代码,其中的值应该从数据库中获取,并为数据库中的每个项创建。

<div class="col-md-12">
                    <div class="card strpied-tabled-with-hover">
                        <div class="card-header ">
                            <h4 class="card-title">Realco App</h4>
                            <p class="card-category">Qui sono presentit tutte le versioni dell'App Realco</p>
                        </div>
                        <div class="card-body table-full-width table-responsive">
                            <table class="table table-hover table-striped">
                                <thead>
                                    <th>Software</th>
                                    <th>Versione</th>
                                    <th>Release Data</th>
                                    <th>Download</th>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>App2</td>
                                        <td>0.9.0</td>
                                        <td>02/01/2019</td>
                                        <td><a href="#" aria-disabled="true"  data-version="App2.apk">Download</a></td>
                                    </tr>
                                    <tr>
                                        <td>App</td>
                                        <td>0.2.3</td>
                                        <td>02/01/2019</td>
                                        <td><a href="#" aria-disabled="true" data-version="App.apk">Download</a></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>

虽然这里是vb.net部分,我连接到db并从clienti\u sw表中获取数据,但现在我需要一些关于如何将这些数据添加到表中的建议。。

Dim SQLConnect As String = ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString

    Dim con As New MySqlConnection(SQLConnect)
    Dim cmd As New MySqlCommand

    cmd.Connection = con
    con.Open()

    cmd.CommandText = "SELECT * FROM clienti_sw"

    con.Close()
qf9go6mv

qf9go6mv1#

在线评论

Private Sub OPCode()
    Dim SQLConnect As String = ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
    'This is where you collect the downloaded data
    Dim dt As New DataTable
    'The using block insures that your database objects are closed and disposed releasing any
    'unmanaged resources
    Using con As New MySqlConnection("Your connection string")
        'You can pass the command text and the connection to the constructor
        'of the command
        Using cmd As New MySqlCommand("SELECT * FROM clienti_sw", con)
            con.Open()
            dt.Load(cmd.ExecuteReader)
        End Using
    End Using
    'In a WinForms app the datatable can be bound
    DataGridView1.DataSource = dt
    'Not sure how this is done in asp
    GridView1.DataSource = dt
    GridView1.DataBind()
End Sub

相关问题