|
I'd say that _dgvTransactionList has to be null or the code would have crashed earlier in the method.
|
|
|
|
|
Hi,
Put a debugger on try{} and see the values in the list. See the quick watch where you are getting null. Check if the FieldNames used for GridColumns in the xaml are same as the names in the list. For example, your list has fields like Id, Name then the GridColumn field names should also be Id and Name.
Please revert in case you find something.
Regards,
Praneet
|
|
|
|
|
I created a new window and everything is working fine. I don't know why I was getting the error, because the code is working. when I got the error and clicked OK, All the data in the DataGrid was loaded correctly but I was still getting the error on every restart. By the way I am new to programming.
Thanks anyway for all the help.
Regards,
Saeed
Saeed
|
|
|
|
|
Hello,
I am developing a project in "Windows Application using c#" there is a requirement for disabling the whole row after when send mail button is click. The process is that there is a button after each row in grid view this button is "Send Mail" button when user click this button the whole data which is in a particular row will be bind in message body and it will be send to particular mail id and the another requirement is that after clicking this button that row must be shown disabled means in a grey color and that button also to be shown disabled .
I am searching but not getting the answer please help me giving the logic behind this .
Thanks
|
|
|
|
|
|
Thanks for reply, but I had tried this it doesn't work
i just want to disable the datagridview column button after performing its action means when user click the gridview send mail column button just only after clicking the button must be disabled.
please provide any other solution.
thanks
|
|
|
|
|
I need to get the stack trace many, many times. There is new StackTrace(true), but its hella slow. Found an article about calling GetStackFramesInternal() instead, so I tried that. It did improve performance a little bit (about 22%). Better then nothing I guess. Obviously, the majority of the time spent is getting the file & line info since StackTrace(false) is much faster then StackTrace(true). I tried using ILSpy to see what the hell was taking so long, but it appears the stack trace and file info is gathered in the unmanaged C world as .NET just calls a C function to get it after a few layers. I understand you have to parse the PDB file to get the file and line info, and I know nothing about the file format, but I'm wondering if that can be improved?
|
|
|
|
|
What are you really trying to achieve?
First you need to gather an ETW trace, then you will be much clearer where time is spent. If the same stack is used over and over again, may be subsequent calls would be much faster.
If possible, try to log an ETW event with stack, then you can do offline analysis with full stack.
|
|
|
|
|
Don't rely on the StackTrace. It's notoriously unreliable, especially in release builds.
|
|
|
|
|
Why does it seem like you're trying to use a stack trace for something it was never intended for?
What are you really doing with this information?
|
|
|
|
|
Umm... getting the stack trace? . That is actually what I'm using it for. I'm writing a logger. Except its intended to be an ultra high performance logger. Getting the stack trace a million times is kinda expensive .
|
|
|
|
|
Yeah, so why would you possibly need the stack trace "a million times"??
I would never need a log of calls that fine grained and so often.
|
|
|
|
|
You probably wouldn't need the stack trace "a million times" per say. But its not unfathomable to have a million log entries or much more. For example, at work, we log every request we get for our newer main product. That table has 1 - 2 million entries right now and its not even fully in production yet.
Unfortunately, as you can imagine, its not possible to get the stack trace retro actively. My logger is highly configurable (think something like Log4Net), so right now I don't know if the stack trace is going to be needed because of how the API is designed.
I grab the stack trace when a log entry is created. However, I guess if I change up the API a little bit, I can make it so the logger knows if someone has registered to get the stack trace, and if not, I don't need to new the stack trace object up.
I dunno about you, but I always like to make my application building blocks as insanely fast as possible. A house built on crap will end up being crap.
That's the reason I don't use Autofaq, MEF or Ninject as my IOC container. While I don't create apps that new up 500k objects through IOC every day, it's nice to know that if I want to, I can do so in 100 - 200ms (MEF2 for example) instead of 7 seconds (Ninject for example).
Not only that, its a little bit of bragging rights to say you have the fastest component x on the planet.
|
|
|
|
|
Uhhhh....yeah. Whatever.
I still don't ever see the need for a stack trace on every log entry call. 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!
The problem with get a tack trace is that the thread is stopped, the entire stack is walked looking for return addresses, symbols resolved, then you get you're trace and thread is resumed.
You're basically not going to get what you would call a "high performance" stack trace. The operation is just too expensive.
|
|
|
|
|
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.
|
|
|
|