|
Dave Kreskowiak wrote: Uhhhh....yeah. Whatever.
No need for rudeness dude. I think you're just very confused. In my previous response, I **AGREED** with you and said you *probably* aren't going to get a high volume of log calls requesting a stack trace. As I said, my logger is configurable. You don't have to request a stack trace, but you *CAN*. Or you can log stuff *WITHOUT* requesting a stack trace. Not every log entry will want a stack trace. For example, with my request log at work, I certainly don't want a stack trace, but I do want one in my exception log. The exception log doesn't have a million rows as I **AGREED** with you in my last response, it has a much lower volume.
As artificial intelligence has not yet been perfect, how would you suggest a logger component know which log entry will need a stack trace? Yes, I can add a bool to the logger call, or I can make it a bit more automated as I plan to do. Although a bool in the logger call would give the user much more control then the automated detection method.
Dave Kreskowiak wrote: Think about that for a minute. What are you going to get in the stack trace? A million examinations of the call to the log component!
UHHH... HUH?
You don't just pull log entries out of your ass, man. You log stuff in specific locations. For my request log, I log the request at the entry point of the service. For my exception log, I log stuff in exception handlers. If you've ever used an exception handler, you should know full and well that you get the stack trace of the **actual exception** and not the call into the logger.
Like wise, if I put a logger call in SomeClass.SomeMethod() you don't get the call stack of the call into the logger component, you get the call stack of the call into SomeClass.SomeMethod(). That's why its called a STACK dude. Its recursive.
Speaking of the call into the logger, do you think I'm an idiot or something? Why would a user want to see the call stack of the logger? They would **NOT**. So I skip over those frames. **Just like every other logger on the market does**.
Dave Kreskowiak wrote: You're basically not going to get what you would call a "high performance" stack trace. The operation is just too expensive.
If you knew at all how stack traces work, you'd know that a stack trace is actually quite fast. Its the file & line info that's slow since you need to parse that out of the PDB file.
Hey, have you ever used the StackTrace class? Did you notice Microsoft put a bool on there to specify if you want the file & line info or not? Did you think that bool was put in there for your amusement? It was actually put in there because obtaining the file & line info is the majority of the time spent on the stack trace.
Anyways... thanks for your useful feedback, I think I've got what I need.
|
|
|
|
|
SledgeHammer01 wrote: Hey, have you ever used the StackTrace class
Yes I have.
|
|
|
|
|
HI,
I am trying to insert text to db using tinymce control, iam inserting text length about 3900 including html tags.
My database column accepts the same 3900 text as I have manually tested procedure with same text. But through UI it is not executing the procedure.
dbCmd.AddInParameter("p_in_division", DbType.String, DDExcDivision.SelectedValue);
dbCmd.AddInParameter("p_in_subject", DbType.String, txtsubject.Value);
dbCmd.AddInParameter("p_in_body", DbType.String, exc_body.Value);
dbCmd.Command.Connection = dbConn;
db.ExecuteNonQuery(dbCmd);
I have debugged the code and it exists when it reaches
"db.ExecuteNonQuery(dbCmd)".
Can anyone guide what could be reason ?
Thanks
Jona
|
|
|
|
|
Have you tried to
1. Put your code inside a try-catch and see if you get an error?
2. Tried your code with a shorter string like "Hello Database"?
2. Explicitly set the length of the parameter. Not sure that will have any effect.
DbParameter.Size Property[^]
|
|
|
|
|
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".
|
|
|
|