473,378 Members | 1,580 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,378 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 932

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 &...
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.