How to add the DeleteCommand in aspx.vb file?

G

Guest

Hi,

How to add the DeleteCommand="delete from table where ..."
related to a gridview in VB.Net, because i have no tag <asp:SqlDataSource >?

This is the content of file grid.asp:
------------------------------------
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>

This is the code in grid.aspx.vb:
--------------------------------
.....(dim ...)
oConnection = New OleDbConnection()
sql = "SELECT ..."
sConnectionString = "Provider = ..."
sda = New OleDbDataAdapter(sql, sConnectionString)
dt = New DataSet()
sda.Fill(dt)
GridView1.DataSource = dt
GridView1.DataBind()

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top