|
I wonder if someone has solved this little problem:
Situation:
1) A data grid is bound to a dataset containing one datatable. There is no backend database connection, the datatable is populated programmatically.
2) At runtime, the user highlights a row in the grid and presses the delete key, intending to delete the row of data.
Now the problem, of course, is that the data isn't really gone. It's still in the datatable. But how do I update the table? A seemingly simple answer is to add a OnRowChangedEvent hander and call AcceptChanges()
protected void OnRowChanged(object sender, DataRowChangeEventArgs args)<br />
{<br />
dataTable1.AcceptChanges();<br />
}
but this generates a stack overflow. Does anyone have an idea what I should really be doing?
Thanks!
|
|
|
|
|
Doug Brower wrote:
At runtime, the user highlights a row in the grid and presses the delete key, intending to delete the row of data.
Now the problem, of course, is that the data isn't really gone. It's still in the datatable. But how do I update the table? A seemingly simple answer is to add a OnRowChangedEvent hander and call AcceptChanges()
protected void OnRowChanged(object sender, DataRowChangeEventArgs args)
{
dataTable1.AcceptChanges();
}
Hi
Override the OnRowDeleted function, and remember to call base.OnRowDeleted(sender, args) after calling your functions. Also have a look at DataTable.GetChanges().
Hope this helps
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
Thanks for the suggestion, and quick response!!
|
|
|
|
|
Hi,
I am looking for a good book or reference about multithrad programming (Thread.Pool...) in C#. Your help is appreciated!
|
|
|
|
|
Hi
Have a look at the following.
http://www.gotdotnet.com/userfiles/toub/ManagedThreadPool.zip[^]
From the readme.txt:
Stephen Toub
stoub@microsoft.com
ManagedThreadPool.cs
August 27th, 2002
v1.0.1
Thread pool class written in C#. Mimics the core functionality of
the System.Threading.ThreadPool class. Useful when using System.Net
functionality in callback delegates.
I must say this guy has written some of the best code I have seen in C#. Although I havent looked at the above library, expect the code to be of high standard
Hope this helps
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
Thank you, Leppie.
|
|
|
|
|
What is the best way to specify the application path in C#? In VB we could use App.Path . I am trying to specify the following connection string and it is drawing a line underneath it so I know it doesn't like the way I have declared it.
string myConnString = "Provider=SQLOLEDB;Data Source="C:\Documents and Settings\User\Desktop\phonebook\phonebook.mdb";" +
"Initial Catalog=phonebook;Integrated Security=SSPI;" +
"Connect Timeout=30";
I have also tried
string myConnString = "Provider=SQLOLEDB;Data Source=@"C:\Documents and Settings\User\Desktop\phonebook\phonebook.mdb";" +
"Initial Catalog=phonebook;Integrated Security=SSPI;" +
"Connect Timeout=30";
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Hi Nick, note the escapes, else the string will end You can AFIAK substitute "\" for "/" in paths. I ussually find it easier to drop a DBConnection on the form, then setup connection string via wizard. Then just copy and paste it to a const string.
string myConnString = "Provider=SQLOLEDB;Data Source=\"C:/Documents and Settings/User/Desktop/phonebook/phonebook.mdb\";" +
"Initial Catalog=phonebook;Integrated Security=SSPI;" +
"Connect Timeout=30";
Hope this helps
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
Thanks leppie,
I actually ended up using the quoted string literal (i.e. - @ ) so it was a little cleaner, however I had the snytax a little messed up this morning. It now looks like this:
string myConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + @"C:\Documents and Settings\User\Desktop\phonebook\phonebook.mdb";
Thanks
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
I would like to know how i can play a wave file through TAPI. My requirement is to hook up to a telephone number through a Modem and when the connection is successful, the application should play a wave file.
There is no adequate support provided in .NET frame work for Telephonic applications.
Can some one help please.....
Harihara Subramanian
|
|
|
|
|
|
This example is an excellent one, however how do i play a *.wav file after the connection is hooked up, also is there any event that specifies that the receiver has picked the phone up.
Harihara Subramanian
|
|
|
|
|
Harihara Subramanian wrote:
also is there any event that specifies that the receiver has picked the phone up.
It sounds to me like you have not done a lot of Tapi programming before Don't worry.. we all had to start someplace... Modems are notoriously (sp) bad for detecting remote connection (and in some cases remote disconnection as well).
Take a look at the following URL for some (a bunch) of answers to common Tapi related issues. Even though this stuff is written for Tapi 2.1, it should fo rthe most part apply for V3+ as well. Not much has changed in the world of Tapi support for modems...
http://home.attbi.com/~bpennypacker/tapifaq/[^]
http://home.paralynx.com/~mike_dunn/faq.htm[^]
Bottom line is that if yuo want to get decent performance from Tapi for an IVR or a voice mail or something like that then you should use a Telephony card like from Inetl/Dialogic or something like that. They were made to work as a voice device where Modems were made to be mainly data devices.
|
|
|
|
|
I have tree view control.I overriden AfterSelect event.I want to get index of primary nodes,not sub nodes selected.I mean when I select oe of sub nodes I found out the index of its parent.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Mazdak wrote:
I overriden AfterSelect event
Dont do that! Do this
protected override void OnAfterSelect(TreeViewEventArgs e)
{
base.OnAfterSelect(e);
}
This is the correct way of overriding event behaviour.
Now when you recieve the event it should work
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
Sorry,I can't understand! Could you tell how to define this function?
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Just read MSDN, it explains it all. Specifically TreeView.OnAfterSelect Method[^]
Sorry, no web link
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
If I understand what you're trying to do, then every TreeNode has a Parent property that will return the Parent TreeNode for the current node or null if the current node is the root. You use this to find the immediate parent or iterate up the hierarchy until you find a node with Parent=null to find the root of the current branch.
|
|
|
|
|
Is it possible to have (by default) an OfficeXP/VS.NET visual style for Windows forms?
|
|
|
|
|
ZZZr wrote:
Is it possible to have (by default) an OfficeXP/VS.NET visual style for Windows forms?
Check the CP articles, the answer is there. CP is your friend.
|
|
|
|
|
Paul Watson wrote:
Check the CP articles, the answer is there.
These are Windows XP Visual Styles. That guy meant OfficeXP/VS.NET visual styles. Try http://www.dotnetmagic.com/[^]
Ñ There is only one MP Ð
|
|
|
|
|
Maciej Pirog wrote:
These are Windows XP Visual Styles. That guy meant OfficeXP/VS.NET visual styles
My apologies, thanks for the correction. Though as my 2 cents MS should really stick to one set of styles and make it available for all controls. Consistency!
|
|
|
|
|
Paul Watson wrote:
Though as my 2 cents MS should really stick to one set of styles and make it available for all controls.
I do agree.
Ñ There is only one MP Ð
|
|
|
|
|
Hey Paul, are you an editor again? I noticed the difference in your user icon. If so, congrats and what is the difference between say site builder/editor/supporter ?
CHeers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|