|
DataTables are in the DataSet: YourDataSet.Tables[0] would be the first table.
You declare and set a variable whenever you need it, You can use it as long as it does not go out of its scope.
SkyWalker
|
|
|
|
|
Hello
It seems that it is not necessary to use the binding source
The Dataset.Getchange method can be used to get modified rows
BUT : there is a problem with deleted rows : the are virtualy added by the getchages but seems empty
How to manage Deleted rows ??
|
|
|
|
|
In order to track the update status of any given row, the DataRow object has a RowState property that displays one of these DataRowState enumeration values:
- Added
- Deleted
- Detached
- Modified
- Unchanged
Have a look here[^], please
SkyWalker
|
|
|
|
|
Thank you
But I already know this....
My question was : HOW to get the original key of deteted row
When I do a getchange() I get all the affected rows with their status : modified, added , deleted
For modified and added rows, the data are accessible and I can use the key to apply in DB
But for deleted row I see nothing (I mean in the debugger)
How can I get back the original information of a deleted row to use the primary key to delete it in the DB ??
|
|
|
|
|
Hello, Finaly I've found a simple way that seems to work very well
MySqlCommandBuilder cb = new MySqlCommandBuilder(adaAddr);
DataSet ch = new DataSet();
ch = dsAddr.GetChanges(DataRowState.Deleted);
adaAddr.Update(ch);
ch = dsAddr.GetChanges(DataRowState.Modified);
adaAddr.Update(ch);
ch = dsAddr.GetChanges(DataRowState.Added);
adaAddr.Update(ch);
return;
|
|
|
|
|
I'm making a program that coverts a regular every day sentence into a random code of numbers and letters. Would anyone know how I could make so when a key is pressed the text is changed to a number or letter that I pick?
|
|
|
|
|
I'm assuming you're using a richTextBox or textBox. But look at the KeyPress[^] event of the control, use can use the event args to determine which key was pressed. Handle the key that was pressed as you wish.
He who makes a beast out of himself gets rid of the pain of being a man
modified on Tuesday, February 19, 2008 4:19 AM
|
|
|
|
|
Hi All,
Stuck in a weird position. I have written a code which lists the various documents in a folder.
As soon as I click on the names of the documents they open up as they are. Word files in Microsoft Word, Excel in Excel etc...... The functionality works absolutely fine as long as I am debugging.
As soon as I fire the same Application from IIS 5.1, the listing is proper, but on the click of the names nothing happens. I have even checked the taskmgr and can c the respective processes like WINWORD.EXE, EXCEL.EXE running, but I cannot c the docs.
Can u guys help me plz?
|
|
|
|
|
Hey,
I think i understand how to asynchronously call a method so that the main thread isn't blocked until it ends. I also think i know how to use the Thread class for the various threading scenarios - starting etc, synchronizing, ThreadPooling etc. I have also read about when an application should consider multi-threading and when it should be avoided.
However i don't know when to go with an Async call over using the Thread class?
Any help much appreciated.
Simon.
|
|
|
|
|
I think here[^] you will learn when to create new threads.
SkyWalker
|
|
|
|
|
Exactly what i couldn't find. Many thanks.
|
|
|
|
|
|
Converting value type into reference is Boxing, and vice-varsa is UnBoxing.
|
|
|
|
|
ReenaSharma wrote: Converting value type into reference is Boxing
Almost.
You don't "convert" anything - boxing is the process of placing a primitive type in an object so that the primitive type can be used as an object. See this Wikipedia[^] link.
/ravi
|
|
|
|
|
let's say we have these 2 classes. Class B inherits from class A
class A
{
}
class B : A
{
}
in the following code
A obja;
B objb = new B();
obja = objb; // boxing
B objc = (B)obja; // unboxing
We can say,
Boxing is assigning an object of the child type to an object of the parent type (higher in the inheritance hierarchy)
Unboxing is (casting) assigning an object of the parent type to an object of the child type.
see also
Eslam Afifi
|
|
|
|
|
Eslam Afifi wrote: Boxing is assigning an object of the child type to an object of the parent type
No, that's not correct. There is no boxing going on there.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Maybe I'm wrong, but this is how I understand it, and I'll be grateful if you clarify this point to me, please.
B objc = (B)obja;
Isn't that unboxing?
Eslam Afifi
|
|
|
|
|
No, that's not unboxing.
Unboxing is when you extract the value from a value type that is stored as an object. What you are doing is merely changing the type of a reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank you. Now I get it. But I have one question. Does this reference conversion consume much time as unboxing?
Eslam Afifi
|
|
|
|
|
Eslam Afifi wrote: Does this reference conversion consume much time as unboxing?
No. Reference conversion doesn't create a new object, it only verifies that the object can be used as the desired type and then copies the reference. If you convert from one known class to another, the verification can be done by the compiler, so the only thing that is done at runtime is copying the reference.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Ok. Thank you so much.
Eslam Afifi
|
|
|
|
|
Have a look at this[^] entry in wikipedia.
|
|
|
|
|
|
Eslam Afifi wrote: class A
{
}
class B : A
{
}
in the following code
A obja;
B objb = new B();
obja = objb; // boxing
B objc = (B)obja; // unboxing
Wrong!
Boxing does not happen with instances of classes.
|
|
|
|
|