473,800 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

delete a row in a sql databse

18 New Member
i want to delete a selected row from the database.the entries of
database is shown by a gridview and i do
<OnRowDeleting= "GridView1_RowD eleting"> in source code.

i select and bind as follows.
[mycode]


string str = "select PNR,CreditCardN umber as 'Credit Card
Number',EmalAdd ress as 'Email Address',Passen gerName as 'Passenger
Name',PassportN umber as 'Passport Number',IPNumbe r as 'IP Number' from
fraud_db order by PNR";
dbconn dc = new dbconn();


SqlConnection myConnection = new SqlConnection(" Data
Source=IT000449 3;Initial Catalog=IBE_fra ud;User ID = sa ; password =
ecomtest ");//Trusted_Connect ion = yes;
myConnection.Op en();
SqlCommand myCommand = new SqlCommand(str, myConnection);
SqlDataReader myReader = myCommand.Execu teReader();


GridView1.DataS ource = myReader;
GridView1.DataB ind();


myReader.Close( );
myConnection.Cl ose();


[mycode]


now when i click on delete link it calls GridView1_RowDe leting(object
sender, GridViewDeleteE ventArgs e) method


can i get the row entries of that row (i mean values of that row )
inside that method? i suppose to delete the row from db using that
entries of row using the query delete * from db where ....
(there is no primaty key in the table.)
is there any other easy way to delete a row from db selected in
gridview.


please help me.
Jun 5 '07 #1
0 1010

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

Similar topics

20
3924
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. Therefore when I look at the results - the deleted ID77 is gone but now I have ID78 with no content! Does anyone know why and how do I make it stop? MIchael
5
5042
by: hpi | last post by:
Hello, I have a table : Batch It contains fields batchnummer : Number (Long Integer) datum : Date/Time status : Number (Long Integer) nr_records : Number (Long Integer)
9
2801
by: Dejan | last post by:
Hy, Sorry for my terreble english I have this simple code for deleting rows in mysql table... Everything works fine with it. So, what do i wanna do...: my sql table looks something like this: id Name Surname pictr0 picrt1 pictr2 pictr3
0
282
by: sajithkahawatta | last post by:
i want to delete a selected row from the database.the entries of database is shown by a gridview and i do <OnRowDeleting="GridView1_RowDeleting"in source code. i select and bind as follows. string str = "select PNR,CreditCardNumber as 'Credit Card Number',EmalAddress as 'Email Address',PassengerName as 'Passenger Name',PassportNumber as 'Passport Number',IPNumber as 'IP Number' from
2
1319
by: bharadwaj | last post by:
how can i delete the database if it is in loading state??? any help
2
3477
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I don't want to use the default db "ASPNETDB.MDF" that is placed in the "App_Data " folder. I have created "myDB.MDF" and have run "aspnet_regsql.exe. All my user data is saved to "myDB.MDF". Can I just go ahead and delete the "App_Data " folder and all its content? -- L. A. Jones
4
2215
imarkdesigns
by: imarkdesigns | last post by:
Hello everyone.. a newbie programmer here wants to ask why is my codes for deleting rows from my databse won't work.... seems that this codes spread to the net and no one refuse to correct it... can someone correct this... <!-- Editable Area --> <?php include ("../dbconnection/connect.php"); $tbl_name="schedule"; // Table name
11
4646
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1. category which comes from database 2. brand which comes from databse according to content of first dropdown . and 3. price which is static. when i am doing these things without ajax on every onChange() thw whole page is refreshing that i do not...
0
1990
by: Slickuser | last post by:
From my PHP page: Grab all data from the database. Go through a loop to generate the HTML. Client side: From the Color drop menu list, if a user change the value. It will grab that value & update to the database based on the hidden ID. DELETE ALL will delete everything the databse.
0
9690
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10251
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.