473,386 Members | 1,621 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,386 software developers and data experts.

delete option in aspx for mysql database with confirmation prompt

hello pals!
i am using mysql database connected in grid view with aspx pages how to use delete option with check boxes (like hotmail inbox)
suggestions will be really helpful
thanks in advance
Feb 4 '10 #1
5 2096
Add a Checkbox Column in the datagrieview and keep a link button "Select All" for selecting all checkboxes. Then delete the rows which has been selected.....
Feb 4 '10 #2
tlhintoq
3,525 Expert 2GB
Database How-to parts 1 and 2
Database tutorial Part 1
Database tutorial Part 2
Feb 4 '10 #3
Frinavale
9,735 Expert Mod 8TB
Once you have added a CheckBox Column, and the user has clicked the delete button you are going to have to loop through each row in the GridView to determine which rows have been checked and then proceed to delete the data.

I'm not entirely sure where you are having problems though.
Are you having problems using the "confirmation prompt"?
Are you having problems with deleting the data?
Are you having problems configuring the GridView with CheckBoxes?

-Frinny
Feb 8 '10 #4
Hello Frinny,
I have added check box in my form and as well confirmation is working too, but in the confirmation prompt, if i click yes the selected record is not getting deleted (i am using mysql and vb code not c#).
please help with some ideas..
thanks in advance
Feb 10 '10 #5
Frinavale
9,735 Expert Mod 8TB
I'm still not sure what you're having problems with....if it's your JavaScript that's causing problems....

Have the submit button return a call to the JavaScript function when it's clicked. That JavaScript function will have to check to make sure that the user wants to delete. If the user clicks No have the function return false...since the button click code also returns false the button click event will be cancelled.

This is a little hard to describe in words so here's an example of what I'm talking about:

Expand|Select|Wrap|Line Numbers
  1. <asp:Button ID="btn_delete" runat="server" OnClientClick="return confirmDelete()" />
Notice the return...if the confirmDelete function returns false then the OnClientClick will return false...which cancels the click event (and the page does not submit to the server). If the confirmDelete function returns true then the click event will proceed as normal.

Now, if it's not JavaScript that's causing problems, and it's your C# code that's not working then you're going to have to post the code that you have for deleting so that we can see what you're doing and help you to find the problem. (Please remember to use code tags when posting code)

-Frinny
Feb 10 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: de Beers | last post by:
mysql_query("DELETE FROM cart WHERE ItemId=$ItemId"); There is the code but the result in my databse is that the ID number changes from, lets say, 77 to 78 with 78's contents being empty. ...
1
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
2
by: John Smith | last post by:
Hello all, I don't know c# that well and thus need urget help. I have a page that displays files from an access database that has a button to be delet file from database. I need a confirmation...
2
by: neoconwannabe | last post by:
Hi, I have an html form with a number of checkboxes that can be checked to delete items. I want to have a javascript alert prompt box to pop up to confirm the delete. I am building my site with...
4
by: Stephen | last post by:
Hello People, Using MS Access 2003 VBA I get the error 3020 Update or CancelUpdate without AddNew or Edit when I run through the following code. Can anyone help suggest anything to try? Thanks....
3
by: Bob Darlington | last post by:
Using Access 2002. I have imported one form and two modules from another database, in order to compare code. Having finished the comparison, I cannot delete them. When I press 'Delete', I get a...
4
by: Liao_xf | last post by:
Sorry for my poor english. In windows2000, I want to disable users' ability to delete directories or files in explorer. I want to use hook to catch the message when user click "Yes" in the prompt...
4
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on...
13
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
0
by: johnmott | last post by:
Hi all, One of the limitations of the GridView control is that the built-in delete processing doesn't prompt for confirmation -- something thats very important for a user interface. True, you...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.