|
Did you try
using(MailMessage message = new MailMessage()
{
From = new MailAddress("mailx@website.com", "it's me."),
Subject = "test",
Body = "Hello"
})
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
thanks. so i have this now:
using ( MailMessage message = new MailMessage()
{
From = new MailAddress("mailX@website.com", "it's me."),
Subject = subject,
Body = userMessage
})
{
message.To.Add(new MailAddress(_strMailAddressX, "FromX"));
message.To.Add(new MailAddress(_strMailAddressY, "FromY"));
SmtpClient mailClient = new SmtpClient();
mailClient.Send(message);
}
return true; all of that is wrapped in a try block. now,
- i could not get the 'To.Add' part to work without 'message.To.Add'. it wouldn't work at all inside the block that sets the other properties. i see that 'To' is a collection but i'm surprised i couldn't add to it while setting the other props.
- it kind of looks like the 'using' portion ends half-way through, when the right parenthesis closes. i tried other places but couldn't get anything else to work. at what point does it actually end here? is the 'using' stmt set up properly now?
- 'return true' is there because i'm setting this up in a class that'll return a bool. all comments appreciated.
tnx.
|
|
|
|
|
Hi,
I want to know how can I play incoming message notification using PC speaker?
can you please help...
|
|
|
|
|
http://msdn.microsoft.com/en-us/library/4y171b18.aspx[^]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
what i want is to force playing sound notification even if the sound volume was set to zero, similar to the old days when sound is played on DOS
|
|
|
|
|
|
Console.Beep[^]. Unless it's a 64-bit[^] system.
The cable to the internal speaker is the first thing I yank out of every PC I work on. I imagine more people being annoyed enough by the sound to have done something similar.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Good catch. That thing is so annoying that it does not even cross my mind that someone would actually use it. I do not even know if that last 10 computers that I have had, the speaker even worked or not.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks
|
|
|
|
|
I have MDI Parent form. I want an alawys visible MDI Child to act like a side bar with a fixed width and every new MDI child I open will occupy the remaining space only when I dock it to fill?
how can I do this?
|
|
|
|
|
jrahma wrote: how can I do this?
public class FormMyToolBox: Form
{
public FormMyToolBox (string aCaption, DockStyle aDockStyle)
{
Text = aCaption;
FormBorderStyle = FormBorderStyle.FixedToolWindow;
Dock = aDockStyle;
TopLevel = false;
Visible = true;
}
Controls.Add(new FormScriptToolBox(
"Ze ToolBox",
DockStyle.Right));
Works for me under Mono. Specifying the maximum or minimum width is done using the appropriate properties[^].
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
sorry this is duplicate post...
kindly delete...
thanks...
|
|
|
|
|
using server client desktop application,
All clients insert and update my database (which is attached to sql server 2008).
And I have a Grid control on a Windows Form which need to be updated automatically
without user intervention.
--(I mean user will see the grid getting new records)--
|
|
|
|
|
Your Windows Form should perhaps have a background timer which checks periodically for changes to the applicable data and updates the grid when changes are found.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I agree with you timer could solve this, especially if it worked in another thread.
but i'm still looking for more generic solution.
it's highly appreciated if you try to help me again.
|
|
|
|
|
You're not going to get a "push" notification from the server, you're going to have to check from your client application under any circumstance. My personal solution if I was to do this would be to create a separate monitoring thread that would update the visible data cache in an application in the background so as not to affect the UI thread of the application. I would let the UI then check for a flag in the data cache indicating that updates were found and update itself. That way the application performance isn't adversely affected by the checking.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
thanks for this explanation,your idea now is clear for me.
did you tried something like this before SqlDependency ?
|
|
|
|
|
I haven't used that. But it does look like a promising lead.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Any idea why the competition isn't using auto-updating grids with every instance of Sql Server?
It's called "bad design".
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
sorry, can't get your point.may you express your idea for me please.
|
|
|
|
|
Auto-updating grids are a "pain in the ass", a "bad idea".
Imagine you editing a name, and a person on the room next to you editing the same name. Imagine Google Wave. Imagine concurrency-errors and a network that nearly collapses under the extra traffic.
Unless you are building a MMO-game, you stay away from real-time updates.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
The idea comes up from time to time, usually from a non-technician. Reason is that it's technically possible, and it sounds like a good idea. WarCraft can push updates in real-time, so why can't Sql Server?
Well, it can, but it's not a good idea. With someone editing in the grid, the entire grid would move (all rows!) when someone deletes the first record. Imagine the amount of network-data required, to keep all the clients up to date.
There are a whole lot of grids out there. Microsoft Access did not implement the feature, nor did the other grids. Ask yourself why.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
thanks bro for your help, I really I appreciate your efforts.
I'll tell you how I tried to solve the problems you mentioned and you please tell me
what do think about my solutions :
* About saving two records at same time I follow the following:
- grid is only for showing data, adding and editing data in a separate form.
- I added a column with datatype of timestamp in almost all database tables.
- when I show editing form to edit a specific record,I select the timestamp for this specific record (and keep it with me in a variable).
- before I execute the update statement to update the specific record I check for the record timestamp and compare it with the timestamp variable,and if there's any changes I display message for user before saving.
* About updating data according to database changes (which occurred by other users) till now I have two choices,
-first one is timer and I dislike
-this idea,the second choice is Using SqlDependency for data change events
|
|
|
|
|
EgyptianRobot wrote: * About saving two records at same time I follow the following:
Concurrency-problems. What happens when two people edit the same record? Whose version is saved? Also keep in mind that the network-traffic and server-usage grows with the number of concurrent users.
No, I'm not going deep into the possible pitfalls; seen enough hacks that "proved" that the prototype works, but have yet to find the first real implementation.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|