I would use App.config aswell as SeMartens describes, but if you prefer to use a seperate file other than App.config, why not make the main program retrieve the connectionstring from a seperate class with a static method and just have that as a dll file. Then if the connectionstring should change you only have to replace the dll with a new one.
I am sending emails with attachment(.txt file) using c#.
I read data from database saved as varchar datatype. I read data in memory stream and output the memory stream as attachment with content type text(.txt file).
It sends emails to gmail, yahoo,hotmail,rediff etc. mail servers with attachment(which is a .txt file) perfectly fine.
(It means there is no problem with code)
But when i send emails to my own mail server it skips the attachment i.e. i get the emails without attachment.
Why make it worse by highlighting the fact he left his mail server IP address, not that it's anything important or useful to the outside world, it can be resolved with a DNS request. But either way, why repeat it and take attention to his error?
Why would they want to transfer the data to Access Do they realize there are reporting solutions that will work without the transfer. Or at least use SQL Server, Express is free and coupled with SSRS it would be better than Access, IMHO
You could do it with a datareader, transfer one record at a time.
Access can be a very good reporting tool but the problem with many Access users is that they tend to want to import the data into access and then report on it. Instead, you should create linked tables in access and then create parameterised queries on which to base the reports. Doing so will ensure that only the data you're reporting on gets copied temporarily into access
SQL Server Express is FREE. Advanced includes SSRS also. You would be setting the company up with better tools and positioning them for better migration. The tools are FREE, only costs a little time to download and install. Rather than having individual copies of Access databases floating around it could be centralized. Better management, more accurate reporting.
I've been poking around Google / Apache.org trying to get to the bottom of this with no luck. There isn't a lot of info anywhere on configuring log4net using pure C# so I thought I'd try here now.
I can log to the "Application" log with no problems. I can also create "MyLog" event log without problems as well, however, writing to "MyLog" fails to actually write an event log entry. The code I'm using to configure an EventLogAppener is:
i want to check system date and my date so i can avoid date mismatch.
when my date is greater than system date then it must give date mismatch error.
I am using it for checking my project expiry date......if anybody have another way then free to tell me.......
Is anybody have code for it????