473,406 Members | 2,378 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,406 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 1059

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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.