I've started getting a very strange exception in my program.
An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module.
That happens sometimes when a window is created (not a specific window, has happened with messagebox and my own forms).
I am using .Net version 1.1. This is my first app with 1.1, so maybe there was some important detail I missed that has changed from 1.0 to 1.1?
I know threads and UI can cause a mess if done badly, but I am not doing any threading at all.
It seems that before the exception occurs, a new thread with no name is created.
VS cannot tell me anything about the thread: there is no call stack, the stack frame selector is unclickable... nothing.
Many threads are created that handle various things, like painting a control or for asynchronous operations. You never know.
Make sure you're compiling a debug build. There's other reasons you might not be able to use some of the debugging tools (threads are always funny when it comes to that), but just to eliminate the obvious I mentioned that.
If you think it has something to do with threading, check that your application's Main entry point is attributed with the STAThreadAttribute, which is the main UI thread. Usually, though, you get different errors if your application is started in anything other than an STA.
As far as changes 1.0 to 1.1, there really isn't much besides new methods and a few new classes, and a few methods and properties that are now obsolete - nothing conceptual is mentioned, though.
All I can think is to click on the Debug->Exceptions menu and break on all exceptions. Changes are that you'll end up looking at assembler code, but it should give you some stack frame if the debugging symbols are loaded. If you're not using a checked build of Windows, they are probably stripped. VC++ does install some program database (pdb files), but not for the core libraries. If you dig around though, you should at least be able to determine which library you're in. That could help solve the problem since most libraries are pretty specialized.
(Not sure if i had to post this here, couldn't find a forums here more fitting, if it's supposed to go elsewhere please remove).
I just finished readying: "Teach yourself C# in 24 Hours, by James Foxall", it really was a nice book, but i feel there are parts it discussed that didn't "fill" my knowledge as much as i'd like. Could someone propose a book, a set of books, or a complete training course that it is best for, learning CSharp, understaning OOP as a concept, and taking you to the next level, an intermediate status to pro (well pro without a proffesional experience).
The next thing is to read all the .NET frameworks docs in MSDN from start to finish. That should keep you busy for a year or 2, but you will be a "pro" To reach the next level, you will have to study the EMCA-334/5 C#/.NET CLR specs to answer all your questions you have left After that stage, you can rename yourself to Heath Stewart or something :p
Thanks ofr pointing these things out for me, but the problem is, i don't trust myself yet to start searching on my own, performing quantum leaps. Even with having finished that book and all the examples/tests in it, i cannot write a simple program on my own, without having 100 backdraws and stuff. Meaning i cannot make code decisions yet, i just type like a blind and hope that this will work. That's why i asked for a book/s that will help me answer questions ( that maybe now i don't know i have, but will surely stumble upon later), and will serve as a quide to get me on knowledge-train, then i will surely have to dig on MSDN library (and CSharp Dev center). And i am also lacking OOP knowledge (only thing i know is what i've read in this book) 'cause C# is the first "real" language i started studying, no c++ background etc.
So if there's a book/s that would fit my needs as i mentioned above, please help me make the right choice
p.s. What is ECMA-334/5 C#/.NET CLR (common language runtime)?
If it's C# you are interested in, then I'd recommend Inside C# by Tom Archer. I certainly think it is the definitive tome on C# the language.
IMO, The only true way to learn is by doing. Books like Teach yourself x in 24 hours are okay for beginners. The best way to learn is to write your own code and read code done by others. There are plenty of good C# examples here at CP to download and read. The only way to learn is to make the mistakes and ask questions when you get stuck.
Sorry for this question but I'm looking for a quick answer.
How does .NET load assemblies? - or better how does .NET find the assemblies to load?
For example: if I have myexe.exe which uses mydll.dll myseconddll.dll, etc. does the runtime scan the folder containing myexe.exe for all .dlls and loads them? What if I have 1000 .dlls in a single folder? Will the runtime load them all or just will scan them all?
My exact question is: I want to organize my program like that
As you might guess what is in ./system/ will always be available and used by main.exe but what is in ./plugins/ could be different.
What methods do we have available to load .dlls? I'm currently reading Sam Haidar's article on late binding. Are there any other methods?
Could you please point me to information, where I can find an answer about this question.
Well, I did plugin loading by first just listing all the DLL files in the plugins directory and then calling Assembly.Load() (I think that's what it was called) for each of them and specifying the file as the parameter.
The OLE DB .NET Provider does not support named parameters for passing parameters to a SQL Statement or a stored procedure called by an OleDbCommand when CommandType is set to Text. In this case, the question mark (?) placeholder must be used. For example:
SELECT * FROM Customers WHERE CustomerID = ?
As a result, the order in which OleDbParameter objects are added to the OleDbParameterCollection must directly correspond to the position of the question mark placeholder for the parameter.
My team has the following task to complete.A solution that consists of 3 projects :
1-Win app that connected to a local DB server(SQL server) .
2-Web app that connected to a remotre server(SQL server).
3-Mobile app for that connected to tha same remote server of the web app.
1-The win app deals with a DB(Local DB SQL server) for updating ,retriving,inserting and deleting.
2-The web & the mobile app deal with a DB(Remote DB SQL server) for tha same purpose.(updating ,retriving,inserting and deleting)
1-The Win app will connect one time per day to update the Remote SQL server with the new data from the Local SQL server.
2-The Web and mobile app connected to the Remote SQL server will update ,retrieve ,delete and insert records in it.
1-If I can use Asp.net web services ,How can I use it?
2-How can i make daily transaction to update the Remote SQL server with the new data at the Local SQL server??
3-How can i make daily transaction to update the Local SQL server with the new data at Remote SQL server ??
4-How can i manage the DB Transactions ?
5-how can i use the same methods(code) for dealing with the DB ,for the win app , the web app and the mobile app?
6-What is the best way to complete this solution?
Thanks for reading to this line.
I hope you can help me.
I know how to do this via Win32 API's, but curious about how to do it in
.net. Is there a way in the framework to change the system's locale? System, not a thread's locale (found this easily in msdn). Doing this for a tool to help automate testing.
Juan Miguel Venturello
Last Visit: 31-Dec-99 19:00 Last Update: 28-Jan-23 17:18