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

datatable

Hello all , My question is why after i delete a row from my datatable it freezes? Its linked to a datagrid. When i add ad update row it works fine but when i want to delete it freeze after the record is deleted

private void deleteRow(dRoutedOrder oStat

DataRow dr = orderTable.Rows.Find(oStat.MasterOID )
dr.Delete()
Console.WriteLine ("delete")
Nov 16 '05 #1
5 1645
Hi,

When are you calling deleteRow()?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Newbie" <an*******@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com...
Hello all , My question is why after i delete a row from my datatable it freezes? Its linked to a datagrid. When i add ad update row it works
fine but when i want to delete it freeze after the record is deleted.
private void deleteRow(dRoutedOrder oStat)
{
DataRow dr = orderTable.Rows.Find(oStat.MasterOID );
dr.Delete();
Console.WriteLine ("delete");
}

Nov 16 '05 #2
on some of the examples i saw when it found the record i want thats the command to delete the row

What i would like is, when it finds the record delete that row or record

Thanks
Nov 16 '05 #3
my program still freeze after deleting a row from datatable

cod
private void deleteRow1(dRoutedOrder oStat
DataView dv = orderTable.DefaultView
Object[] searchValue = new Object[1]
dv.Sort = "OrderID"
string test = (oStat.RemoteOID.ToString ())
searchValue[0]=(test)
int i = dv.Find(searchValue)
orderTable.Rows[i].Delete()

}
Nov 16 '05 #4
Hi Newbie,

But still from where are you calling deleteRow1 method?

--
Miha Markic [MVP C#] - DXSquad/RightHand .NET consulting & software
development
miha at rthand com www.rthand.com

Developer Express newsgroups are for peer-to-peer support.
For direct support from Developer Express, write to su*****@devexpress.com
Bug reports should be directed to: su*****@devexpress.com
Due to newsgroup guidelines, DX-Squad will not answer anonymous postings.

"Newbie" <an*******@discussions.microsoft.com> wrote in message
news:35**********************************@microsof t.com...
my program still freeze after deleting a row from datatable.

code
private void deleteRow1(dRoutedOrder oStat)
{

DataView dv = orderTable.DefaultView;
Object[] searchValue = new Object[1];
dv.Sort = "OrderID";
string test = (oStat.RemoteOID.ToString ());
searchValue[0]=(test);
int i = dv.Find(searchValue);
orderTable.Rows[i].Delete();
}

Nov 16 '05 #5
No, no.
I did mean the piece of code where you invoke deleteRow1:
deleteRow(oStat);

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Newbie" <an*******@discussions.microsoft.com> wrote in message
news:34**********************************@microsof t.com...
The programs receive a number then does a search in the datatable for that number if it finds the number the next command it to delete that row. No
user interaction just to view data. Is that what you ment by where is it deleting?

i have tried this code too, it finds and delete the row but still freeze

private void deleteRow1(dRoutedOrder oStat)
{
DataRow foundRow;
string i = (oStat.RemoteOID .ToString ());
foundRow = orderTable.Rows.Find (i);
this is the call ---> orderTable.Rows.Remove(foundRow); orderTable.AcceptChanges(); }

Nov 16 '05 #6

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

Similar topics

5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
5
by: Stefan Turalski \(stic\) | last post by:
Hi, I'm wondering if there is a way to send a method parametrs by ref when DataTabel is a type of this value ? I done some sort of select over DataTable columns, just by removing them froma...
1
by: TaeHo Yoo | last post by:
Hi all, After sorting and grouping data using a dataview, then how to transfer the changed datatable in the dataview to a datatable in C#? Cheers
0
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
7
by: Raymond Lewallen | last post by:
Which would be the proper way or the reason for using any of the following or combinations of the following? These are the 3 ways I've figured I can do what I want to do, I just don't know which...
3
by: Gene Hubert | last post by:
I'm using DataTable.ImportRow to move data from one datatable to another... Dim dt, dtTarget As DataTable Dim dr As DataRow dt = DirectCast(Me.DataSource, DataTable) dtTarget = dt.Clone...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
6
by: Pete Wittig | last post by:
Hi, I have a DataTable and I want to get a subset of the rows within it. I use the Select method to get my subset and the results are in a DataRow. I want to put those Rows back into a...
0
by: Maart_newbie | last post by:
Hi all, I've got a question about returning the value of a pk-column to a DataTable after inserting a row (via a data-adapter) using MySql5. Here is the SQL and code concerned: ...
5
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...

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.