473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to add the DeleteCommand in aspx.vb file?

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
May 24 '06 #1
0 1016

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
2
by: Peter Afonin | last post by:
Hello: I'm deleteing data using Datagrid, then rebind it. For some reason ItemDataBound event doesn't fire after DeleteCommand. Why is this? Is it by design, or I'm missing something? I have...
4
by: Rodger Dusatko | last post by:
After entering the sql statement da.deletecommand.commandtext = "Delete from Users where username = @username" I set the parameter to the username I wish to delete. This successfully deletes the...
4
by: Nathan Sokalski | last post by:
I have a DataList that has an Button as one of the controls in it's ItemTemplate. The Button has a CommandName="delete" attribute, but when I click it the DeleteCommand event doesn't even get...
14
by: Averell | last post by:
Hi, I made a gridview with VWD. The gridview has the Delete button set (ShowDeleteButton="True" in the <asp:CommandField>). It works perfect, but i would like to add a warning before the record...
2
by: phil | last post by:
Hi, The connection and DeleteCommand of a gridview are defined in the aspx file like this: <asp:SqlDataSource ID="SqlDataSource1" runat="server"...
1
by: Jason Barnett | last post by:
I dropped a DataGrid control onto a Web UserControl (.ascx) and added columns for Editing and Deleting data. At first, I had everything working; when the edit button was clicked the row entered...
0
by: jobs | last post by:
Gridview with datasoure with deletecommand. Why do I need an event handler? Isn't this enough? I know this code has worked when I use a fielditemtemplate <asp:GridView ID="RouteGridView"...
1
by: renatois | last post by:
DeleteCommand in SqlDataSource using DetailsView Hi guys, Figure that: - I have two related tables by IDName: 1 - table Name (fields: IDName, Name) 2 - table Products (fields: IDProduct,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.