|
Hi dhaim!
Thanks for your reply.
Maybe I'm not clear in explaning the problem.
I have a C# Console Application (this console application will launch internet explorer) that will be called by Access VBA.
So, it's not possible for the Access VBA to maintain the reference to the console application.
I need a way to read the current launch internet explorer and check the url and reposting certain data again to the web.
Could anybody help me to solve this problem ?
Thanks
|
|
|
|
|
hi i am using crytal report to print my values from the database
in my database i have 3 rows...
Category Quantity Unit_RAte
apple 5 60 RS
mango 10 80 Rs
if i select mango and i have to print the mango for 10 times in my report
i should get the result as ,
mango 10 80 Rs
mango 10 80 Rs
apple 5 60 RS
apple 5 60 RS
apple 5 60 RS like this i have to get the 20cm space for each rows.....
|
|
|
|
|
in the design page increase a little bit space below the item that u have placed in the page. so u get the space for each and every item u bind there.
|
|
|
|
|
try
{
smtpClient.Send(mailMessage);
}
catch (Exception ex)
{
eventLogImport.WriteEntry("SMTP Email error: could not send email.", EventLogEntryType.Warning);
}
Hi,
The above code still throws an unhandled SMTPException when smtpClient.Send is called.
SMTPException is derived from System.Exception so should it not be caught?
Thanks
|
|
|
|
|
Hmmm... if the smtpClient uses another thread, this won't be caught, you need to actually set a handler for exceptions from another thread.
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 )
|
|
|
|
|
Interesting.
This is occuring in an event handler, however i thought the method which triggers the event should be on the same thread. I'll look into it as there is some SQL data access going on which may make and asynchronous call.
Thanks!
|
|
|
|
|
Out of interest, here is my call stack, I dont think there should be an issue but if you do could you let me know, thanks again!
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at TransactionService.ServiceMain.importLogic_DataAccessSQLException(Object sender, ChainStoreTransactionImportExceptionEventArgs e)
at BusinessLogic.ChainBranchTransactionLogic.OnDataAccessSQLException(Object sender, ChainStoreTransactionImportExceptionEventArgs e)
at BusinessLogic.ChainBranchTransactionLogic.ChainStoreTransactionImport(EPOSTransactionDataSet transactionDataSet)
at TransactionService.ServiceMain.ProcessTransactionFiles()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
|
|
|
Interestingly enough, I see that the first thing this does is start off a new thread. As Christian said, this could well be the issue. Try using Application.ThreadException to catch the exception.
|
|
|
|
|
blakey404 wrote: SMTPException is derived from System.Exception so should it not be caught?
Of course it will be caught...
|
|
|
|
|
it definately isnt being caught
|
|
|
|
|
blakey404 wrote: it definately isnt being caught
So what exception are you getting where? Please post a stacktrace with line numbers and post the 3-4 lines aournd where it claims the exception is happening.
|
|
|
|
|
not the most fun in the world debugging, as i'm developing a windows service;
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at TransactionService.ServiceMain.importLogic_DataAccessSQLException(Object sender, ChainStoreTransactionImportExceptionEventArgs e)
at BusinessLogic.ChainBranchTransactionLogic.OnDataAccessSQLException(Object sender, ChainStoreTransactionImportExceptionEventArgs e)
at BusinessLogic.ChainBranchTransactionLogic.ChainStoreTransactionImport(EPOSTransactionDataSet transactionDataSet)
at TransactionService.ServiceMain.ProcessTransactionFiles()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
|
|
|
blakey404 wrote: at System.Net.Mail.SmtpClient.Send(MailMessage message)
It must catch it (you still dont say the exact exception type I was asking for), if it does not, either your code is wrong, or something else.
So how do you get that stacktrace? How did you print it out/copy it?
I also note, you turned off debugging (and hence no linenumbers). It is not possible to accurately pinpoint the exact exception point in an optimized run mode.
Lastly debugging a service is no more dificult to debug than any other application.
1. Start service.
2. Set a few breakpoints.
3. Attach to service process with debugger.
4. Wait for exception.
|
|
|
|
|
i see something else thats wrong-ish
your compiler should be giving you a warning "ex is declared but never used"... if you don't intend on using ex don't declare it...
catch (Exception)
{
eventLogImport.WriteEntry("SMTP Email error: could not send email.", EventLogEntryType.Warning);
}
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
It is indeed , i intend to use Exception ex once i can actually catch the exception!
|
|
|
|
|
if thats the case than its all good
ive seen programmers IGNORE compiler warnings and that just irritates the living S**T out of me... just thought id point it out incase you didnt notice
good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
haha thanks
|
|
|
|
|
I'm searching for a source code for scanning a PC for installed software (versions) and then check a definite web site for updates.
|
|
|
|
|
hellkiller wrote: I'm searching for a source code
Then Search Google
|
|
|
|
|
hi! it's again me I want to know something...I have a listview and I am populating the list with files from ftp folder. I want to get just the xml files, so that means...only file who are finishing with extension '.xml'.
I am doing like this:
I am making a function where it get's all the files like this:
StreamReader reader = new StreamReader(response.GetResponseStream());
string line = reader.ReadLine();
while(line !=null)
{
result.Append(line);
result.Append("\n");
line = reader.ReadLine();
}
it works fine and I am getting all the files in that folder, but I want to get just the xml files...any help with that? Thx ahead
|
|
|
|
|
well, I guess System.IO.Path.GetFileExtension is a good place to start, if you're unable to do the filtering at the point of asking for the group of files ( which I know you can do if you're searching the local file system )
Get the extension, call ToLower() ( so that XML, Xml, and xml all match ) and check if it's .xml. If it is, add it.
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 )
|
|
|
|
|
thx, that helped me a lot...and I solved it...have a nice day
|
|
|
|
|
You can use System.IO.Directory.GetFiles(<<directory name>>"*.xml"); to return a list of files that end with xml.
|
|
|
|
|
where exactly I can put the System.IO.Directory.GetFiles(<<directory name>>"*.xml")?
I tried something like this:
string[] xmlFiles = System.IO.Directory.GetFiles("ftp://URL", "*.xml");
but it doesn't work, can you pls show me how should I use, cause I haven't used before. Thx ahead
|
|
|
|
|
I don't think it will work for FTP, that's what I was alluding to in my reply. So, you need to filter them manually, in the manner I suggested.
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 )
|
|
|
|