|
I have Events table with date and time.
I need to send an email 20 minutes prior to the time the event starts. I am thinking of using Task Scheduler along with C# Console app. Should I use a timer to compare server time and event time? Whats the best approach to make it less memory intensive?
Thank you so much for your help folks!
|
|
|
|
|
I'd like to suggest you say more about the frequency of the Events you are going to be monitoring.
Is there any periodicity, any pattern, in how/when events are entered into the system:
1. how frequent are they: are there gaps of days or some other time periods in which there are no events.
2. can a new event be added at any time
3. do the events arrive in groups, or individually
To the extent that the events can be predicted in any way, then I think that will influence the strategy you choose.
« I had therefore to remove knowledge, in order to make room for belief » Immanuel Kant
|
|
|
|
|
events are scheduled with at least 24 hour advance notice.So event can't be added today for today.
Individual event. For example: Power shot down today at 7:00 pm so I need to send an email at 6:40pm. Individual event.
Any day of the week
|
|
|
|
|
Why don't you just schedule an email notification event when you create the event itself? If you only have several events on the calender at a time, I'd probably just use the task scheduler API. If you have a lot of events on the calender, I'd probably just create a service that loads the entire event table on load and then grabs the new records at midnight for the previous day.
|
|
|
|
|
but how to compare time? If event is scheduled for 7:00pm and task scheduler is set for for lets say 6am every day... I need to run some kind of ticker to compare time all the time, right?
|
|
|
|
|
Hi,
I am designing a website. The designing is almost complete.
But I am noticing that there is many images and file is unlinked and in useful.
It is unnecessary present in the project. I would like to remove/delete it. But
it almost impossible to detect these types of files manually, impossible. So is there any way
to find these files ? Please help me.
|
|
|
|
|
Please do not cross post. As mentioned on the other one, I have never seen a tool that can do this since there are many ways that files can be referenced. You'll have to do it manually.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello All,
I'm struck in Editing equation(which is added as an image from the Equation editor) in richtexbox.Does anyone knows any freeware equation editor which provides the equation editor contents to be stored as XML and which can be loaded into Richtextbox and then edited as text in richtextbox.
Thanks,
Avinash
|
|
|
|
|
|
Hi,
I have added a dropdownlist for qualification.
The dropdownlist text and its value is diffrent. Which is as follow.
Like
Text Value
BA 3
Bcom 3
BCA 3
BSc 3
MA 5
MSc 5
MCOM 5
When I run update query it is not giving desired result.
if(!IsPostBack)
{
string UserName = Session["SUSERNAME"].ToString();
SqlConnection con = new SqlConnection("Data Source=AI-PC;Initial Catalog=db*******ony;uid=mahuri_admin;pwd=fr******68");
con.Open();
SqlCommand com = new SqlCommand("update tblRegistration set Qualification='" + Qualification_DropDownList.SelectedItem.Text + "' ,Qualification_Point='" + Qualification_DropDownList.SelectedValue.ToString() + "' where username='" + UserName + "' ", con);
com.ExecuteNonQuery();
con.Close();
lbl_Message.Visible = true;
}
What the Problem I am facing suppose I select BSC as qualification to update.
After clicking Update button when the page reloads the first text with the value 3 (BA) get selected and the BA is updated in database instead of BSC.
Please help me.
|
|
|
|
|
Your code is susceptible to SQL Injection[^]. Update it to use a parameterized query:
using (SqlConnection con = new SqlConnection("..."))
using (SqlCommand com = new SqlCommand("UPDATE tblRegistration SET Qualification = @Qualification, Qualification_Point = @Qualification_Point WHERE username = @UserName", con))
{
com.Parameters.AddWithValue("@Qualification", Qualification_DropDownList.SelectedItem.Text);
com.Parameters.AddWithValue("@Qualification_Point", Qualification_DropDownList.SelectedValue);
com.Parameters.AddWithValue("@UserName", UserName);
con.Open();
com.ExecuteNonQuery();
}
As to why you're updating the wrong qualification, the problem is that your DropDownList contains items with the same value. When the form is posted back to the server, only the value of the selected item is sent - for example, "3". The server has no way to determine which item with the value "3" was selected, and so it chooses the first one.
The only way to fix the problem is to ensure that each item in the list has a unique value. That means you'll need to get the points from somewhere else - probably using the same source that you're currently using to populate the list.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi.
Ive been given a project to change crystal reports into bitmap format.
Please do help!!
|
|
|
|
|
That makes no sense. Crystal Reports are for creating printed reports. What does that have to do with bitmaps?
|
|
|
|
|
Hm, rather than printing the reports he wants to send them per email in the form of bitmaps. You can open bitmaps on virtually any system, can't you? That means less harm to trees.
|
|
|
|
|
Bernhard Hiller wrote: rather than printing the reports he wants to send them per email in the form of bitmaps. I don't see that in OP's question.
|
|
|
|
|
As Bernhard pointed out, it makes sense in very specific use cases (which the author didn't mention, but they don't matter to answer the question, IMO). Imagine you create the Crystal Report on a System but want to send it somewhere where neither PDFs nor Crystal Reports work (for whatever reason it may be). Still, your argument remains valid, but remember that we can't read the OPs mind and there might in fact be a use case (unimaginable to us) giving his question sense.
The console is a black place
|
|
|
|
|
Yes, and there might be a million other things in his/her mind. So what? My response was an attempt to get OP to explain in clear terms what they were trying to achieve.
|
|
|
|
|
Marco Bertschi wrote: Imagine you create the Crystal Report on a System but want to send it somewhere where neither PDFs nor Crystal Reports work (for whatever reason it may be
Keep in mind that the system wouldn't be able to support HTML either, because that is another possible output type.
So what sort of system doesn't support html but does support bitmaps? One of course might also wonder if this limited system only supports one type of bitmap.
|
|
|
|
|
jschell wrote: So what sort of system doesn't support html but does support bitmaps?
A system which is hardened down to meet some specific requirement defined by the customer, e.g. the customer doesn't want to have a browser installed?
The console is a black place
|
|
|
|
|
Marco Bertschi wrote: the customer doesn't want to have a browser installed?
Then they must be using a bit map viewer? Which would have its own limits?
|
|
|
|
|
Exactly. And since there was no mention of: number of pages; page size; etc.... It is rather premature to suggest solutions (to a poorly defined requirement).
I was once asked to send some (electronic) ascii text reports in a "larger font" because the final recipient didn't "see too well". Instead, I suggested they change the font size on their "viewer".
|
|
|
|
|
Probably the easiest way for you to do this would be to install an image printer[^] driver, and print to that rather than the default printer.
|
|
|
|
|
Damn. You were faster
Anyways, if he doesn't want to buy the ZAN license he could still use a free tool. We live in great times with loads of cool free stuff out there.
The console is a black place
|
|
|
|
|
As far as I'm concerned, Crystal Reports are designed to be printed out to whatever format, the format usually being a PDF or classic paper - I'm with Richard on this. Nowadays, we as Developers are in the lucky situation that a lot of freeware is out in the internet.
My approach would be to get a virtual printer driver which allows you to print a bitmap image ( instead of a physical piece of paper, or a PDF ) and then 'print' your report with this virtual printer. Of course this leads to the question if you don't want to print a PDF instead, if it is for the viewability of the report on different systems. If you want to use the report in a program which can't display Crystal Reports (for whatever reason it may be) stick with the Bitmap printer.
I had a quick look around, and found a few Bitmap virtual printers which I'd try out if I was you:
- ZAN Image printer [^] {Commercial License!}
- Virtual Image Printer Driver[^] {GPLv2}
The console is a black place
|
|
|
|
|
Consider this code:
public static T ConfigSetting<T>(string settingName)
{
return
} I already know it's not possible, because the caller needs to specify the type, but I want to know if there are other ways to achieve what I want, or if I have overlooked something simple.
|
|
|
|