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

delete a row in a sql databse

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.
[mycode]

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
fraud_db order by PNR";
dbconn dc = new dbconn();

SqlConnection myConnection = new SqlConnection("Data
Source=IT0004493;Initial Catalog=IBE_fraud;User ID = sa ; password =
ecomtest ");//Trusted_Connection = yes;
myConnection.Open();
SqlCommand myCommand = new SqlCommand(str, myConnection);
SqlDataReader myReader = myCommand.ExecuteReader();

GridView1.DataSource = myReader;
GridView1.DataBind();

myReader.Close();
myConnection.Close();

[mycode]

now when i click on delete link it calls GridView1_RowDeleting(object
sender, GridViewDeleteEventArgs 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 1054

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

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. ...
5
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
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...
0
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....
2
by: bharadwaj | last post by:
how can i delete the database if it is in loading state??? any help
2
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...
4
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... ...
1
by: Bakarre | last post by:
To display a field from databse and calculate time different -------------------------------------------------------------------------------- Good day, i have problem to display a field from...
11
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....
0
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 &...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.