The ref keyword has a special meaning when applied to reference types. When ref is applied to a reference type, you can actually make the variable point to a different object altogether. Passing without the ref keyword (the default) will only allow you to change the state of the object, you cannot make it point to a different object.
It depends on you design your application and how you managed your device classes. You can display understandable and friendly message to the user because most of the end users are No-wise operator. If you try to display technical errors in your message this will confuse them so a friendly message and if possible what to do next.
for eg: in this case you can show "Failed to connect to the device. Please try again" you can use the same message for any error that related to the connection and write the actual error in your log file so that field engineer or programmer can check the real problem from the log files.
We are creating a Software's extension dll. Here we will be using the Software's base dll which will be there in Software's Installed Location. But the extension dll will be installed inside a subfolder(Extensions) of the Software's Installed Location. In code i have added the Software's base dll reference and developed the code. Now what happens is the Software's base dll is copied inside the subfolder(Extensions) also which is not accepted. I should only take the Software's base dll from Software's Installed Location.
As the Software's Installed Location can be anything, how can i add dynamic reference to the Software's base dll. Please help.
And you are loading Extended dll dynamically.
In that case Extended dll should be built using Base.dll.
There are two possibilities there.
1. You have already referred to something in App.exe which is in Base.dll. And thus Base.dll will already be loaded into the process (AppDomain) space
2. You have not referred to Base.dll. In that case the .Net load process will attempt to search for Base.dll. Presuming it is not in GAC then it will search in the App.exe directory and thus it will find it. And load it.
The above presumes you haven't messed with anything including setting up your own AppDomains.
Now I have two questions here.
I am using the graphics object to create a customized report from a database. To ensure WYSIWIG, I use the same functions in the paint event of the panel with the printPage event of a PrintDocument after passing the necessary event arguments.
So far there is no trouble. Printing and previewing works just the way I want.
(NB - Did not use the printPreviewControl as I felt it was way slower than a panel. Don't know if I am right.)
So, Am I going the right way to create a WYSIWIG compliant application?
I want to save the created report into a XML format. I used the XMLWriter class, and was almost succesful in saving the report. I was ready to pat myself in the back and call it a day when it occured that I knew no way to serialize a Brush object. All I want to store is just the brush color. How can I get the color of a brush object? Because I don't see any properties exposed. Any workarounds?
As for the brush, figure out the type (likely a solid brush), cast it to that type, and serialize the properties you want.
e.g. (for a solid brush)
// brush is declared as Brush brush, but is a solid brush instance
if(brush is SolidBrush)
SolidBrush sb = (SolidBrush)brush;
// Serialize the properties of the brush here
elseif(brush is LinearGradientBrush)
// And so on and so forth.
// Repeat for other brush types as required
i need help to check the avaialbility of username from database. i am developing this website in a .net 3 tier framework. i already search for coides through google but all the codes are in 2 tier based. please help..............
Don't get so hung up on "3 tier" and stuff like that.
You have a very specific problem you are trying to solve so just focus on that alone.
What you need to do is run a query against your database to check if a value exists. That's it.
publicbool UserNameExists( string username )
// Connect to your database...
// Run a query to check if username exists.
// NOTE: Use a paramatarized query.
// Something like: SELECT count(*) FROM [YourUserTable] WHERE [YourUserNameColumn] = @username
I had been working on C, C++, VC++ technologies for many years. I want to start learning C# .Net. I have little knowledge about C#.Net. I want to know from where to start.
And also what is the difference between C#, .Net, ASP.Net, ADO.Net etc etc ..
The important thing is to find a book or course in your native language - this makes life a lot easier for you because you aren't also trying to translate English while you learn.
After that, the Addison Wesley, Wrox, and Apress books are generally pretty good - just read it from start to finish and do all the exercises to make sure you don't miss anything too fundamental. Just avoid any books with "in XXX days", "For Dummies" or multiple exclamation marks in teh title!
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
I am testing code that uses backgroundWorker. A similar application run on a different computer runs code that is practically the same, and is faster, but doesn't use backgroundWorker. Could the backgroundWorker be taking longer than code that doesn't use the backgroundWorker? Other differences are 32 bit vs 64 bit(mine)computer. My code also uses more dll's, but using a profiler with my code, the part that was taking long was a repeated call to an external dll, which the other code also does.
If it's done wrong, sure. Plus multi-threading adds more complexity which can mean things like checking a semaphore and locking. This could lead to lessened performance, but that could just mean that the problem isn't suited to multi-threading.
We'd need to see the code to be sure.
Last Visit: 31-Dec-99 18:00 Last Update: 24-Jul-16 10:10