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

How to Delete a row from dataset ??

Hi ,
i fetched some records from SQL Server using data adapter
and filled it to the dataset. now i want to add some rows
to the dataset and reflect it to the database.. i can do
it perfectly with no problem. but when i try to delete
some rows from the dataset, it gives error..
can any one help how to do this ??
Thanks.
-Imayakumar
Jul 21 '05 #1
2 1456
Deleting DataRow

DataRow[] drDelRows = ds.Tables[0].Select("DELSTATUS = 1");
foreach(DataRow drRow in drDelRows)
{
ds.Tables[0].DeleteRow(drRow);
}

This should work. Can you also give me the details of the error you are
getting.

Thanks,
Jagan Mohan

"Imayakumar" <im******@hotmail.com> wrote in message
news:00****************************@phx.gbl...
Hi ,
i fetched some records from SQL Server using data adapter
and filled it to the dataset. now i want to add some rows
to the dataset and reflect it to the database.. i can do
it perfectly with no problem. but when i try to delete
some rows from the dataset, it gives error..
can any one help how to do this ??
Thanks.
-Imayakumar

Jul 21 '05 #2
have u used the SQlCommandBuilder ..? if not use that and then update ur dataset.
Jul 21 '05 #3

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

Similar topics

4
by: baylor | last post by:
i have a DataSet (TDS). It has 4 rows in it. i want to erase those. For the life of me i can't figure out how Option 1: foreach foreach (DataRow row in dataSet.MY_TABLE.Rows) { row.Delete(); }...
5
by: Grant | last post by:
Hello, How come when I add a new row to my dataset table it shows up as changed (agencyData.Haschanges() = True) but when I delete a row the dataset thinks here are no...
4
by: Steven Nagy | last post by:
Hi Have a problem that consistantly occurs in my applications where using a DataAdapter (OLEDB) and a dataset. Using a simple process of adding a row to the dataset table and then calling the...
2
by: NoSpam | last post by:
Hi, I am working with C# and ASP.NET with code behind and a SQL Server. I'm making an e-shop. When clients see what they have in their basket, I added a function DELETE to delete a line. It took...
6
by: Mark Kurten | last post by:
for some reason when i delete a row, the row doesn't get deleted from the acutal data table in SQL server. my code follows what am i missing? thanks. Dim row As DataRow Try
5
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew...
7
by: travlintom | last post by:
Hi. I'm new to VB.net and am used to working with recordsets (much easier). I have a datagrid that, when the user double clicks on a row, I am giving them a chance to delete it. I thought this...
5
by: rn5a | last post by:
The .NET 2.0 documentation states the following: When using a DataSet or DataTable in conjunction with a DataAdapter & a relational data source, use the Delete method of the DataRow to remove...
13
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am using VS2005. I created a Windows Appication project. Inside the Server Explorer, I created a new SQLExpress database, and then created a new table. I added the rows, making my first row an...
5
by: Tony Johansson | last post by:
Hello! Here I have a working program that delete the specified row in the database. It works fine but I want to fully understand it. In this example the SQLCommandBuilder will automatically...
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...
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
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,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.