|
Hi
Can anyone tell me how to bind vertical Scroll event of treeview control with the VScrollBar scroll event?
Thanks in advance
A.K
|
|
|
|
|
What is the best way to manage the deletion of master records that have child records? I load the data from the database into a dataset. I would like to give the users the following functionality: If a user selects a number of records to be deleted and some of them have child records, I would like to give the user the option of either skipping those with child records or deleting them (including their child records).
I am using Visual Studio 2003 and C#.
Thanks.
Kobus
|
|
|
|
|
I would suggest doing this in the database via a stored procedure. No doubt there is quite a bit of opinion on this but may I suggest using logical deletes and not actually removing the records until a later time. I tend to use a bit field as a logical delete then during a schedlued window do the physical deletes.
|
|
|
|
|
Hi,
Can anyone let me know how to declare a local const in a method
using CodeDOM? I am trying to get an output that looks like this:
public void SomeMethod()
{
const int MyInteger = 56;
}
One workaround is to use a CodeSnippetExpression and output the literal
"const" keyword. But that'll make it specific to C#. I prefer to keep
the output language option flexible.
Thanks in advance for your help.
-Venkat
|
|
|
|
|
I'm pretty sure you won't be able to do this. Not every .NET language has the ability to declare constants inside a method. You'll have to stick to putting it inside the class.
Logifusion[ ^]
If not entertaining, write your Congressman.
|
|
|
|
|
Hi guys
i have a service that suppose to connect to data base and process
when faild to process i want to stop it.
when i stop the service by the ServiceController
it pop up a message "...service on local computer started and then stopped, some services stop automaticly..."
and if i dont stop the service then its status stays as started...
how can i stop the service without getting these message
here is my code:
public void StartMethod(object stateInfo)
{
try
{
CacheDataManager.InsertItemsToCache();
}
catch(Exception ex)
{
this.EventLog.WriteEntry(ex.Message.ToString(), EventLogEntryType.Error);
this.Dispose();
ServiceController myService = new ServiceController(this.ServiceName);
myService.Stop();
}
protected override void OnStop()
{
try
{
CacheDataManager.ClearItemsInCache();
}
catch
{
this.EventLog.WriteEntry("The service has stopped", EventLogEntryType.Warning);
}
}
the service is working fine when process succeded.
please help me with that , i spend 2 days for looking a solution
Thanks in advanced
Guy
-- modified at 6:06 Thursday 7th September, 2006
|
|
|
|
|
Have you checked the system event log? It might have some more information about your specific error. It could be that your service is terminating automatically on startup.
--------------------------------------------------
|
|
|
|
|
no
it is start and process fine
but i want it to be stop if the process that he should do is fails
like when he cant connect to DataBase.
i'm catching the Exeption and set the service to be stop
while doing that i get the message on Services window.
i dont want do get this message when stopping the service from its code.
|
|
|
|
|
I still think it would be a good idea to check the event log for any additional info. Also you could check the CanStop property of the service controller before doing stop.
As a last ditch attempt you could just throw an exception without handling it. This should terminate the service!
--------------------------------------------------
|
|
|
|
|
i've checked the event log and its just give in formatin about service states
it look ok since its stop after i press ok on the services window message.
i added the code for checking if service can stop and still get the message
try
{
CacheDataManager.InsertItemsToCache();
}
catch(Exception ex)
{
this.EventLog.WriteEntry(ex.Message.ToString(), EventLogEntryType.Error);
this.Dispose();
ServiceController myService = new ServiceController(this.ServiceName);
if(myService.CanStop)
{
myService.Stop();
}
if i throw exceptin without handling, then its just stays as "started"
running it in debug mode "myService.CanStop" set to true
well it is doing the stop but popuping the message as well
any idia how to make these pop up message not show ?
the message is "The <myservice> service on local computer started and then stopped, some services stop automatically if they have no work to do, for example, the performance logs and alerts service"
-- modified at 7:34 Thursday 7th September, 2006
|
|
|
|
|
Hi all.
I have a simple question that I just can't get right.
When you create your deployment project, you set the version of your installer in the properties.
Now my question being is in my code, how can I retrieve that version number, the one you would assign to your own app?
I googled and searched and only version that I found to retrieve was the framework version, and that I don't need.
I'm sure it must only be a very simple statement....
Thanks in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
If it is the assembly version you are looking for you can get it by doing Assembly.GetExecutingAssembly and doing a GetName on the returned assembly object. That will have the version.
--------------------------------------------------
|
|
|
|
|
I have two richtextbox out of two each one will be shown depending upon some condition.initially richtextbox1 will be there.and richtextbox2 will appear in some event.But when rich textbox2 is appearing the focus remains in the textbox1.How to use the setfocus function to set the focus at richtextbox2
|
|
|
|
|
when u show the second richtextbox, call the Focus() method of that
richtextbox.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
I want to open a text file so I am using this code
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = "c:\\" ;
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
But my application contains a richtextbox where I want to show the contents of the file
How to do it
|
|
|
|
|
Your question not specify what do you want to do please add more info in to your question!
add:You have bad title!!
|
|
|
|
|
When I will click the open menu dialog box will appear where I will browse the text file.And contets of the text file will be shown in the richtextbox which the application contains
|
|
|
|
|
After the user selects the text file from the OpenFile dialog
use the richtextbox.loadFile() method and specify the filename in the method.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
But how to store the selected file name at run time,so that I can pass the parameter to load File method
|
|
|
|
|
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)<br />
{<br />
richTextBox1.LoadFile(openFileDialog1.FileName);<br />
}
You can store FileName in registry
Chatura Dilan
SC Java Programmer
|
|
|
|
|
u can use a global variable to store the name of selected file (at the event the file is being selected) and then use that variable to pass it to the method.
sAqIb
|
|
|
|
|
Please I need to use the class of TapeOperator in .Net framework 2003.
|
|
|
|
|
Yes, and?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
how do we use global variables in C#???
reply soon
STABd
|
|
|
|
|
You don't, there is no such thing.
You can use static classes/variables for the same purpose.
|
|
|
|