|
I think this should work. If it doesn't, reply me back..
for i=0 to array.length-1
if array(i) = 1 then
check = true
else
check = false
end if
nextsuchitamanandhar@hotmail.com
|
|
|
|
|
Morning CPians, dig me out here
I need to send an E-mail from my app through the default E-mail setup on a client system. (invoices and order confirmations, exciting stuff)
I have learned through some Googles that MAPI used to do this (no I haven't tried, it looks pretty old), then MAPI was replaced by System.Web.Mail, which has now been replaced by System.Net.Mail. Great, BUT, these .NET replacements both need to be told the E-mail server's address and/or domain, which my users will definitely not know.
The Outlook automation assemblies look like an easy option, but I'd just as soon not limit myself to Outlook, or move outside .NET
Is there some way to have System.Net.Mail just send the mail through whatever default E-mail settings exist on a user's machine?
Perhaps I can look up the E-mail settings somewhere? Magically impersonate the user?
Ideas? Guidance?
|
|
|
|
|
Hi,
I use MailMessage, MailAddress, and SmtpClient classes, and keep some strings as settings, including the mail server name (which SmtpClient constructor needs).
I know of no way to solve it without settings for all possible situations.
|
|
|
|
|
If you need it to actually display the message in the users default email client (like Outlook, Live Mail, etc.) you can use some interop to MAPI, but you need to be very careful about resource leaks. Keep in mind that this isn't officially supported and is actually not recommended, but I think as long as you are careful and only use it to open a mail message it's safe.
Otherwise, you can use the built-in .NET classes but you will need to ask the user for the email server. You can save that information as a setting somewhere so you only need to ask for it once, but there isn't a way (as far as I know) to automatically get that information.Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Hrmph.
Thanks very much both of you, I suspected as much.
Cheers!
-Jack
|
|
|
|
|
Hi
I am facing one proble with DataAdapter.
Problem is I have multiple rows in my DataTable and i am going to save it.
I have set DataAdapter 's 'ContinueUpdateOnError' property to true
so that i can continue on to next row.
I have 6 rows and i get some check constraint error from DataBase on my 4th row.
and i have called whole operation through .Net TransactionScope Class.
because of error i will call Dispose method of TransactionScope Object.
so actually no row will be saved.
but what happened , the next 2 rows after 4th row , that is 5th and 6th rows got saved in DataBase !!!!!!! ????????????
strange .........
please
if you have some idea reply me.
Thank you.
you can see my code
..
..
..
..
DataAdapter daWOStdVal = new DataAdapter();
..
..
daWOStdVal.ContinueUpdateOnError = true;
daWOStdVal.RowUpdated += new SqlRowUpdatedEventHandler(OnWOStdValRowChng);
daWOStdVal.Update(dtSCStdVal);
..
..
..
Regards
Gaurav Teli
|
|
|
|
|
Why would you set ContinueUpdateOnError to true if you don't want it to continue updates on error? Rather than call dispose why wouldn't you just set a flag to call rollback when you are done processing rows? It seems you are doing everything you can to make sure it isn't a real transaction.
|
|
|
|
|
Dear All:
I installed VS 2008.NET in my computer which is Win7 System. I tried to find the .NET configuration tool snap-in but I couldn't find either the mscorcfg.msc or the administrative tool from the start menu and control panel.
I read the article on the MSDN website but none of the method mentioned there solves the problem.
Most importantly, it seems that the file mscorcfg.msc is not installed on my computer.
Besides, I tried to install the framework SDK 2.0 but it doesn't solve the problem
Could anyone point me how to find the configuration tool please?
ThanksAsura
|
|
|
|
|
SDK 2.0 is the way to go.
There is an updated article on MSDN[^] for .Net 3.5 which is what you will have.
Hope this helps.
|
|
|
|
|
Hello,
I would like to ask if how do allow 2 input only in a textbox
after entering decimal.
|
|
|
|
|
use regular expression validator and in the validation expression specify this: (^\d*\.\d{2}$)Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello,
Would you mine if could you give me some sample of using the format validation
I have tried using lastindexof but my code doesn't work unless if I enter
"." at begginning of my textbox.
my code is this
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
TextBox1.TextChanged
If TextBox1.Text.IndexOf(".") Then
TextBox1.MaxLength = Val(TextBox1.TextLength) + 2
End If
End Sub
Thanks,
dfan23
|
|
|
|
|
He's already given you the regular expression you need to use. Why haven't you used that? The code you've got here isn't validation, it's input constraint - which is a different thing altogether. What happens if you put in .AA (hint - your code thinks it's valid, but it patently is wrong)?"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello,
Can I ask again if there would there would be other way.
I would like to ask also doesn't that the regular expression check
if the input in textbox is as what the expression use?
Thanks,
dfan23
|
|
|
|
|
I don't believe on restricting user for inputting. rather i will do it as following.
This code will accept user decimal input and after user looses focus of this text box the validation logic will do the stuff for you.
private void textBox1_Validating(object sender, CancelEventArgs e)
{
decimal result = 0.00M;
decimal.TryParse(textBox1.Text, out result);
textBox1.Text = decimal.Round(result, 2).ToString();
}
Let me know if you like this. wrote:
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
If you don't want to use a regular expression check, you could always use a masked edit box and set it to restrict the input."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi everyone,
Can anyone tell me how to create a email in .net 3.5 .
In which template do i create it.
Does a windows form application work or do i need to use the web applications.
Wat all settings must be done.
I have done the SMTP settings in my system and its working.
explain wit with the code.
Please help
i am stuck from 2 days.
I am a beginner
|
|
|
|
|
The MailMessage[^] class will do what you need. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Don't post to multiple forums I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
How to watch StringBuilder strings while debugging?
Hi, I was wondering why I can't make my VS 2008 to watch StringBuilder string-values while debugging?
According to this article from Code Magazine:
www.code-magazine.com/articleprint.aspx?quickid=0503061&printmode=true
, it should be possible, even in VS 2005 (standard) according to figure 3 & 4 in the article.
What am I missing?
ps: i'm a newbie
BR Lars
|
|
|
|
|
Just highlight over the string you are adding to the SB.. you will see what it is adding. As far as breakpoints or a watch, hmm, I would set something like a conditional watch that dumps the tostring method of the sb, then you will see it being built but you will soon run out of realistate in the debugger for long strings. If that is the case you could create a substring method to display just the last few lines at once...
|
|
|
|
|
Hi TheArchitectmc, thanks for your reply.
While debugging, it is interesting to be able to see the actual value of the StringBuilder "string" as it is shown in the article (figure 3), not just what is added.
CloseUp of figure 3 here:
www.code-magazine.com/ShowLargeArticleImage.aspx?QuickID=0503061&Image=figure3.tif[^]
Apparently even in VS 2005, it is possible to do what I ask for, as you can see in the CloseUp picture at "m_StingValue", where the user are offered 3 different visualizer types for better viewing.
Since it is advised to use StringBuilder "strings" instead of normal strings for many purposes, I would say that being able to watch these while debugging, should be a mandatory option "out of the box", without the need for adding code.
I hope someone can help
BR Lars
|
|
|
|
|
LarsXYZ wrote: Apparently even in VS 2005, it is possible to do what I ask for, as you can see in the CloseUp picture at "m_StingValue", where the user are offered 3 different visualizer types for better viewing.
Hmm, Visual Studio has what are called 'Visualizers' there is a special folder you place them in on your installation of VS. I think that is what you are seeing.
Here is a link for one some one created:\
Platinum Bay - StringBuilder Visualizer[^]
Hope this is what you are looking for. But you could also build your own custom stringbuilder visualizer if you wanted, I can see the whole thing in my head, so I have never needed one, I do use other visualizers for LINQ and Lambda Expressions...
~TheArch
|
|
|
|
|
Hi TheArchitectmc, thanks again for your reply.
I tried the StringBuilder visualizer from Platinum Bay & copied the dll to the visualizers folder, like:
c:\MVS_2008\Common7\Packages\Debugger\Visualizers\StringBuilderVisualizer.dll
In a project I created a reference to the StringBuilderVisualizer.dll and wrote the Imports statement (Imports StringBuilderVisualizer) in the start of my code.
That didn't work & the new StringBuilderVisualizer was stated as an "unused" reference??
How can that be?
I must say that i'm quite surprised if the feature I'm asking for, isn't in the VS 2008 standard package
Basically, the only info I get when watching StringBuilder "strings" is:
Capacity
Chars (with a standard message: In order to evaluate...)
Length
MaxCapacity
Thats it!
The most important part: The actual string-value, are missing
BR Lars
|
|
|
|