|
I start a service on logon(written in C#.net). This service starts another process. My application has an interface with allows administrators to restart the service. However, when this service is restarted, it kills the child process launched from it. I want the child process to be alive even when the service is stopped on windows 2000. This issue exists only on windows 2000 by design.
Can any one help me out in this?
|
|
|
|
|
pranu_13 wrote: This issue exists only on windows 2000 by design.
That's the answer. If it's by design, I think it's not possible to work-around it.
|
|
|
|
|
public class a
{
public int i = 0;
}
public class b:a
{
public int i = 2;
b bb = new b();
// bb.i is 2
how should i access the value of i of class a through object b
}
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Are you not getting a warning when you build the code?
You can access variable i of class a using
base.i
|
|
|
|
|
You can use as , for instance
bb = new b();
Console.Writeln((bb as a).i);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks for the Reply...
how can i use the bixing concept in this case ?
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
As usual.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
This has nothing to do with late binding. Late binding is when you create an object where the class of the object is determined at runtime.
To properly declare a member that hides the member in the base class, you use the new keyword:
public class a {
public int i = 0;
}
public class b : a {
public new int i = 2;
}
The new keyword tells the compiler that the hiding was intentional, so that it doesn't produce a warning.
To access the hidden member, you just have to cast the reference into the class a:
b bb = new b();
a aa = bb;
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i'm looking for some articles for editing gpedit.msc. i looking for much detailed articles
thank you...
|
|
|
|
|
|
Using .NET v. 1.1. Trying to implement a method that would insert rows from DataSet.Table[0] to an exsisting, empty database table which has identical structure. In my case the data of DataSet is fetched from SqlServer and inserted to SolidServer. With the following code the job gets done, but i'm wondering whether there is a more efficient way to do it?
With the code listed below, inserting e.g. 10 000 rows takes about 30 seconds and that's too slow for my purposes.
public void UpdateData(OdbcConnection connConnection, DataSet dsTmp, string strTable) {
OdbcCommandBuilder CommandBuilder = null;
OdbcDataAdapter daAdapter = null;
OdbcTransaction trans = null;
try {
trans = connConnection.BeginTransaction(IsolationLevel.Serializable);
daAdapter = new OdbcDataAdapter();
daAdapter.SelectCommand = new OdbcCommand("SELECT * FROM " + strTable, connConnection, trans);
CommandBuilder = new OdbcCommandBuilder(daAdapter);
daAdapter.UpdateCommand = CommandBuilder.GetInsertCommand();
daAdapter.Update(dsTmp);
trans.Commit();
}
catch (System.Exception ex) {
throw ex;
}
}
|
|
|
|
|
Unless you can find an ADO.Net driver for SolidServer, you're stuck with ODBC. I did a quick search for it and didn't find anything. Mind you, I've never worked with SolidServer.
Depending on your application, you might just want to fire off a background thread to process the database update so the user doesn't sit and wait (the assumption being that it's a UI app update).
|
|
|
|
|
hello,
I'm dying here, trying to implement an ITemplate class. What I'm after is to dynamically build a listview itemtemplate with a number of labels. Has anyone managed to do this?
Best,
Morten
|
|
|
|
|
Hi,
I am having one content page, Menu on Masterpage and details on content page. Menu strings will be taken from database. Now what happens whenever I click any menu, automatically my master page get loaded and the menu string also taken from database. I don't want it to be taken up always from database, I need some way to preserve it in master page itself.
Any Luck.
Be simple and Be sample.
|
|
|
|
|
You should look into caching the data from the database. Take a look a the caching page directive. If you're referring to the page refresh, you could look into ajax to avoid unnecessary page refreshing.
|
|
|
|
|
Hi, I need to use a PropertyGrid to display various properties and allow the user to change the values.
The first problem is that I've never worked with a PropertyGrid before and after searching for tutorials and experimenting on my own, I still have no clue.
Almost all tutorials I found were about modified versions of the PropertyGrid that require you to already know how to use the standard version, which obviously doesn't help me.
The second problem is that at runtime I don't know anything about the attibutes.
I neither know the name, the type, the category, the description nor the value.
Is there a way to dynamically add a collection of properties to a PropertyGrid and have it determine the necessary attributes (such as category and name) at runtime?
Thanks in advance.
|
|
|
|
|
Megidolaon,
Just assign:
propertyGrid1.SelectedObject = theClassYouWantToView
MSDN[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
It's not that simple.
I have a class called Task which has List of TaskParameter objects.
Each TaskParameter object has the properties "Name", "Type" and "Value".
"Name" should be displayed as the name of a property in the grid, "Type" I want to use to validate the user input and "Value" is the value of Parameter.
The amount of Parameters, their names, types, values, categories and description must be dynamiccally assignable because they change from Task to Task and the Tasks (the Tasks are also subject to change at runtime so I can't just create a different class for each Task).
Is there a way to create a class that allows me to dynamically assign names, types, values, categories and description (readonly and browsable are secondary, it's assumed all properties that are in the TaskParameter collection are browsable and assignable by the user) for a property at runtime and also displays a whole collection of them at once?
So far the only noteworthy results I had when using only a single TaskParameter object and when I used an array created from the TaskParameter List of the Task class, it only displays the "Name", "Type" and "Value" properties but without any descriptions, defaults or anything else.
|
|
|
|
|
Hi,
The PropertyGrid is a complex component. If you want to use it, I recommend you to dig in the various docs, howtos, blog posts, etc. The Microsoft PropertyGrid is not very flexible but it can be powerful when you know all the internals of the ComponentModel stuff. A good starting point is the "Microsoft PropertyGrid Resource List" (see signature).
If you still can't make it work, ask some detailed questions, one per particular issue (yours is a bit vague). About your last sentence, use the DescriptionAttribute and DefaultValueAttribute. If you need them to be dynamic, you will need to publish your properties with the help of a custom type descriptor and custom property descriptors.
At last if a 3rd party component is an option for you, Smart PropertyGrid.Net is a time saver to build dynamic contents.
Best regards,
Nicolas Cadilhac @ VisualHint
Smart PropertyGrid.Net
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Smart FieldPackEditor.Net / DateTimePicker
|
|
|
|
|
hi ,
can any one help me out in selection of range.
for exmaple we have two list consisting of 1 to 10 each
from first list we have selected 3 and other 7
in the second transaction we cannot have a rane say from 2 to 5.
Also when we log off the application and log in again we should see that we do not interect the selected ranges. i have sql database for storage application and developing application on c#.net.
pls help urgent
|
|
|
|
|
I can't follow the logic of what you want. Why can't you go from 2-5, how does that relate to 3 and 7 ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
select x = a if x falls in the range 3-7
then its illogical to have select x=b if x falls in range 2-5
coz in such case x would satisfy both the condition.
|
|
|
|
|
So what you really mean is that your second selection and your first can't be the same value ?
2 is not in the range 3-7
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what i mean that no two selection range should intersect each other.
for eg:- range is 3-5
5-7
and not like
2-5
3-6
coz the value four falls in both the selection which is not possible
|
|
|
|
|
Well this is partitioning a (discrete) interval in not intersecting intervals. What is your trouble about (please detail)?
BTW are you voting down Christian?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|