|
I want to find out if an excel file (Let us say "c:\ABCD.xls")is currently open.
I am using c# and Excel Interop.
Thanks
Abhishek
|
|
|
|
|
Try to open the file exclusively. If an exception is returned, it's in use.
|
|
|
|
|
i have a listview in my program and whenever the item is checked or unchecked i want certain things to happen. how can i accomplish this without the item checked event handler taking over every time i add an item to the listview?
|
|
|
|
|
numbers1thru9 wrote: i have a listview in my program and whenever the item is checked or unchecked i want certain things to happen. how can i accomplish this without the item checked event handler taking over every time i add an item to the listview?
Those statements contradict each other. Unless you mean that the CheckChanged or what ever it's called event is being fired when you add an item to the list view?
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
ok say i have a list of items in the listview, when i either check or uncheck them i want certain things to happen. but if i add an item to the listview, it fires the event handler as if i checked or unchecked an existing item and i want to block it from doing that.
|
|
|
|
|
How about when you add an item to the list view use the "Tag" property to indicate that it's just been added and thus ignore it later in the code:
private void AddItemToList()
{
ListViewItem lvi = new ListViewItem("New Item");
lvi.Tag = "ItemJustAdded";
this.listView.Items.Add(lvi);
}
private void listView_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (e.Item.Tag == "ItemJustAdded")
return;
}
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Ed.Poore wrote: How about when you add an item to the list view use the "Tag" property to indicate that it's just been added and thus ignore it later in the code:
You'dthen need to clear the tag either in the handler, or in the add method otherwise checks will be permanantly nonfunctional in new items.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
That was left as an exercise to the reader
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Put your code in the ItemCheck event handler, rather than ItemChecked . ItemCheck does not fire when an item is added.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
hi,
how to use two different font in a textbox
please help me
thz...
Kamal
|
|
|
|
|
I think you need to use RichTextBox control. Using RichTextBox, you can set different font for the text
|
|
|
|
|
You can create a new font with English &Tamil And use it Or you can use RichTextBox.
Thnaks.
K.Alex
|
|
|
|
|
Hi All,
I seem to be going round and round in circles: could someone kindly set me in the right direction:
How can I get a list of all the database providers installed on my machine using C#?
Thanks,
Martin.
|
|
|
|
|
The following will give you the Datalink properties dialog box.
Add References:
Under COM select:
Microsoft ActiveX Data Objects 2.8 Library
Microsoft OLE DB Service Component 1.0 Type Library
Using MSDASC;
Using ADODB;
namespace Whatever
{
class whatever
{
void Main()
{
DataLinksClass dl = new DataLinksClass();
dl.hWnd = this.Handle.ToInt32(); //use this line if calling from a form
Connection obj = (Connection)dl.PromptNew();
MessageBox.Show(obj.ConnectionString);
/* ^^^^^^^^^^^^^^^^
|
|
|
|
|
hi,
when sending mails using SmtpClient, does it open connection each time I do .Send()
if yes how can i avoid it?
If no what is the mechanism used to send Email.
cheers
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
So, you want to delay the sending of emails until a determine time?
|
|
|
|
|
coolestCoder wrote: mean to say that you need only 1 connection until all the mails you want to send are handed over
this is what i mean !
Is it possible !
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
Sagar K. Godbole wrote: does it open connection each time I do .Send()
I dont think you mean to say that you need only 1 connection until all the mails you want to send are handed over ? If this is the case then you might be unhappy that there is no setting which can persist the connection. ( though i havent checked it myself, it is my perception )
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
yes i meant that.
.send() is a blocking call.
i need to send mails at one go with one connection, this is to get rid of Timeout wait in .Send() which takes place for each Mail that i need to send and if there are too many then its that much of wait for my application,
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
If it's a problem, why not send it in another thread?
|
|
|
|
|
i have arround 300-500 notifications to send at one go..
do you mean those many Threds...
I thought i could do a single connect and if it fails i will
come to know immidiately....
right now ihave a collection of MailMessage objects which i'mpreparing in advanc and then sending it one by one
Thanks,
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
Do they all have the same content?
|
|
|
|
|
no ,
notifications are per action like Task Created,User registed etc..
if they are same is there way to do bulk send?
thanks,
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|
|
Yes, add the people to the "to" list. Instead of one email per recipient, add them to the recipient list, and send one email.
|
|
|
|
|
well thanks,
but thats the way emails are already generated, with multiple To,CC addresses..
------------------------------
Its not the fall that kills you; it's the
sudden stop at the end.
|
|
|
|