实际上我已经开始使用VB.NET和ASPX了,我会把我的数据库中的数据添加到我的引导表中,实际上这是一个静态表的代码,其中<'td'>的值应该从数据库中获取,并从数据库中为每一项创建<'tr'>。
<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>虽然这里是我连接到DB并从clienti_sw表中获取数据的VB.NET部分,但现在我需要一些关于如何将这些数据添加到表中的建议。
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()发布于 2019-01-10 05:10:03
行内注释
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 Subhttps://stackoverflow.com/questions/54113431
复制相似问题