|
Thank you for your reply.
I've tried to stay away from using strongly typed data sets in favor of "self-healing" code. I'm forced to use VS2003 with .Net 1.1, so this may not be a problem with the later version(s), but when the database changes, i.e., a column goes from not null to null, we've had to update the strongly typed data sets and the programs. I'm more interested in having the code able to deal with nulls directly. However, I'll need to look at the link you gave, it may be that we're not using stongly typed data sets properly.
As I said in my first posting, I want to be able to create a class structure instance to contain all of my database column data. Currently I'm testing the columns for null as they are read from the database using a query. If the value is null then I set a paired member flag variable to true and a 0 or empty string, or some other default value in the value member variable, and if the column isn't null, then I'm setting the flag to false and store the column value in another member variable. The flag member adds the suffix '_Is_Null' to the name of the one used by the value member.
This works well enough, I just need to check the '_Is_Null' suffixed flag member to see if the database value was Null or not to determine how to use the value member variable. However, when it came to sending values back to the database via a stored procedure I wanted to "hide" this code so the assignments easier to read. Instead of passing both the flag member variable and the value member variable to the function in which I was hiding the test, I decided to pass the name of the value member into the function, and use Reflections to look up the paired flag member and its value, then return the appropriate value to be assigned to the stored procedure's parameter. This too works well enough, except that because I was passing in the name of the member as a string instead of the member's value, I'm not able to take advantage of the compiler check for misspelled member names. So, I want to use the value member instead of its name in the function call.
However, when I tried using them with the debugger I could see the data types of the parameters, but I couldn't figure out how to get the names of the variables passed in to them with the function call. Another issue is that Reflections tells me what the containing class's type name is, but not the instanced variable, so if I had more than one instance of the class, how would I know that I'm looking at the right instance when I resolve the paired flag member to see if it is Null (true) or a value (false)? In my current code I hard-code which parent class instance I'm using, this isn't a problem in this one case because there is only one instance of the class, but I'm pretty sure that Reflections techiques could be used inside the function to could get this information from the variable being passed in as the parameter.
Thank you
|
|
|
|
|
Hi folks,
I am nearing the end of the first cycle of developement for my application. We began this with the .net framework 2.0, However we are now interested in using WPF and for that it appears we need to upgrade to 3.0.
My question is does anyone know if migrating an application from .net 2 to 3 is a big task and would we need to undergo any major changes. Obviously at this stage we don't want to risk breaking the application too much and don't have the time to undergo any major reworking.
Thanks for your time
Darren Sim
|
|
|
|
|
.NET 3.0 is actually .NET 2.0 + WPF, WCF, and WF (WinWF). There should be no risk at all. Even going from .NET 1.x to 2.0 isn't a big risk. Very little gets removed or deprecated (deprecation is really only a problem for future Frameworks the currently desired version). The biggest thing to consider is the user experience of taking a new dependency that has little market penetration at the moment. For example, a reboot may be required before you can even set up your product.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heath! It's been a long time since you've grace the forums with your presence! We've missed your infinite wisdom in everything Windows!
Welcome back!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
As you can see[^], I've been pretty busy.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
How many hours a day are you putting in?!
Looks like my life with the Fed Government! I swear, they go out of their way to break everything they can and still call it "Production Quality".
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Heath, here's a question for you. Does the /quiet switch tip also work for VS 2003 SP1?
|
|
|
|
|
Off the top of my head, no. That uses an older wrapper that doesn't support (because they didn't exist when it was written) the standard Microsoft command-line switches for update packages. You can search my blog for details.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
OK. Well I've installed VS 2003 SP1 at work and it wasn't too bad. I used the /quiet trick for VS 2005 SP1. Reason I ask is because at some stage I will be applying the SPs to my home versions.
Kevin
|
|
|
|
|
At the microsoft launch event, the presenters said that the .NET framework 3.0 is the same as .NET 2.0 but it includes WPF, WCF, and CardSpace (might be missing a category, but still). Your applications should work fine with .NET 3.0, but if you want to take advantage of WPF then you will need to rewrite the GUI aspect of your applications using the .NET 3.0 tools. But the source code change from .NET 2.0 to .NET 3.0 should not change.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Thats what I thought, but always better to be sure
I think recreating the GUI is not an option at this stage - it's almost complete as is, and the project deadline is looming ever closer (as always). This is something I will look into further in the future, as my application is using a layered architecture it should just be a case of replacing the GUI if required.
Thanks for your help guys
|
|
|
|
|
Hi,
Using pdflib library in C# I have created a pdf file which is
protected using owner password .Different options are disallowed like
print, copy contents etc. Things were working very fine untill i came
to know about some password crackers which could easily crack the
file , eliminating the password , thus making it possible for
operations like printing, copy etc .
The study showed that using user password as well will make the file
strong enough to be decrypted ,but "user password" is not a solution
in my case .
The code which actually creates a pdf file using pdflib is as under :
PDFLib obj = new PDFLib();
obj.begin_document(FileName, "masterpassword=23wdlm3ldjwld4w
permission={noprint}");
Now i wonder even that the file is encrypted using 128-bit
encryption , how a password cracker can retrieve that stored password
form the encrypted file .What operation is performed by the cracker to
remove the password and making the file accessible for all options .
Can any one please help me in this ....
Regards,
Madni
|
|
|
|
|
You can encrypt the file all you want, it won't help you. Your problem is that in order to use it, it has to be decrypted at some point before it's used. This is where the hacker is going to get his hands on the file and just do what he did before.
There is no way you can 100% protect the file. You can only slow the hacker down...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Even if you were to handle encryption on the server where every users is given a separate, licensed private key to decrypt, the user in your project would only need to bypass the upload for the server to encrypt the document. So long as anything executes on the clients' machines, you can't entirely prevent them from doing anything to your code. Dave's absolutely right: you can only slow them down.
Take recent events. Protection for HD-DVD and Blu-ray were both cracked by a good debugger finding the private keys stashed in an application that needed them to decrypt. They didn't hide them well enough. All other apps simply hide or obfuscate their keys. It's not impossible to get them.
If you read Bruce Scheier's wonder "Applied Cryptography", it reads (and is famous for stating) that givne infinite time and resources, anything is crackable; it's only a question of encryption strength vs. information worth that dictates when a cracker will get the information they want (or if they even bother).
Note that a distributed approach to solving your problem is about the best you can do. So long as each client gets their own decryption key (or you can developed a shared decryption for group management, which some DRM enables currently) you can at least revoke it on a per-person or per-group basis. A would-be cracker would need an individual's decryption keys or decipher the message the hard way without them.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi all,
I've got a little question about system colours and xp themes.
Most objects in windows xp change colour when you change theme. In the .Net framework you have the SystemColors enumeration which you can use for objects to be appropriatly coloured with each theme.
However, i've noticed there are some colours that aren't represented in this enumeration. For example, if you right click on a folder and go to properties, then to the customize tab, there are several group boxes with text on them. In the xp-default and silver color schemes, the text is blue, but change back to windows classic theme, and the text is black.
I've checked every system colour in the enumeration, and not a single colour is blue in both the xp-default scheme and the silver scheme.
I've looked around on google but can't find anything relating to this. Does anyone know what colours Windows is using. Obviously, i've considered the option of manually defining the colours, and altering them when the user changes the colour scheme, but there must be a simpler way than this.
Simon
|
|
|
|
|
Simon Stevens wrote: Does anyone know what colours Windows is using.
You should be able to do a print screen and use a program like Paint Shop Pro or Photoshop to get the specific color of the pixels in the text.
It sounds like you may have to manually alter the colors used, I believe you can listen in on theme change events in Windows XP to tell when a theme has changed.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Yeah, I figured I was going to have to do something ugly like that.
Thanks tho.
Simon
|
|
|
|
|
Visual themes are a different sort of beast. There are themes installed on your system that define way more categories of representations than SystemColors , and if you want to use themes you have to owner-draw these on your controls yourself. .NET 2.0 makes this fairly easy for controls in the base class library (BCL). For your Windows Forms application's entry point, use the Application.EnableVisualStyles() method like so:
class Application
{
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new MainForm());
}
} If you want to draw themed text, borders, etc., on your owner-drawn controls, read Rendering Controls with Visual Styles[^] and Custom Control Painting and Rendering[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Cheers, that really helps.
Simon
|
|
|
|
|
I am facing a very rigid problem. Project requirement is to integrate NUNIT with Crystal Reports and then write NUNIT Test cases for each Crystal reports designed... Please help me in integrating NUNIT with Crystal Reports And afterwards in writing NUNITs for the same
Harshal M Nemade
|
|
|
|
|
how to use a WMI Provider to monitor chat application...
how to insert a Provider in chat application...
kim
|
|
|
|
|
|
Hello All:
I was able to create a package .EXE & MSI. But on the installer I want to add some checking on the target machine if it has .NET Frame work install or not. If target machine had .Net Framework install skip,and if it does not have .Net Framework then install it. Please help
Thanks in advance.
Eyungwah
|
|
|
|
|
Try using NSIS. It's a scripting system used and developed by the winamp team.
company, work and everything else @ netis
|
|
|
|
|
Hello!
Im trying to write a deployment project in VS.net 2005.
What Im trying to do is this.
Take the target installation path and write this string value to the registry.
I just cant figure out how to do this. I know how to write to the registry, but somehow I need to get the target path and write this parameter to the registry.
Very thankfull for any help.
|
|
|
|