|
Triggers (and cursors) are evil. I avoid both wherever possible.
Why don't you TEST something, stick as many triggers on a field as you can and see if it breaks. Then throw the bloody lot out and design your database with some intelligence!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
LOL - well said.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I was wondering if there is an easy way to save the properties of the objects such as Checkboxes, Textboxes, comboboxes, etc. in VB.NET that doesn't use the registry. I am looking for a way to write it to a file, then on load read from that file and change the settings back to what they were when it was saved. I have been searching for quite a while how to do this, but to no avail. I was originally thinking that I could write the information to a text file then set the information in that text file to a string and run that string as code however, I couldn't find a way to get the string to run as executable code. If you have any ideas for either of these please tell me. Thanks.
modified 8-Sep-21 21:01pm.
|
|
|
|
|
Running a string as code is both easy, widely documented, and a terrible way to do what you're after.
One possible way is to use reflection to get the properties of each control and store them, then use reflection to set the same properties on the same named controls. An easier way that needs more work as your form changes, is to store specific properties in a format you define and read those to place them back on the controls.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
I use XML to do the form state/size[^]. No reason why you can't use it for controls.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You can use Application Settings to save properties of the objects like Textbox.Text or any other...
|
|
|
|
|
Dear all,
I have a simple program that user can insert unicode or ascii text in a textbox. How to tell it is a Unicode or ascii? Is there any function in .Net?
Thanks.
ma tju
Pengaturcara Perisian
Subang Jaya,Selangor, Malaysia
Ring Master SB MVP 2008
Subang Jaya MOP (Otai)
|
|
|
|
|
All strings in .NET are unicode.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a simple for each loop that goes through my entire collection, performs tasks and then continues, simple enough right? Th ehwole point of my collection is it traps all changes made so a person can undo them, each collection is a series of changes. The problem is I have to undo them in the order which they where done, and my collection goes from the first entered in the collection to the last, I want to do it the other way around.
Do I have to resort my collection? If so there is no index its just a collection of objects, I was thinking a for loop using count going to 0, but I wasn't sure if that would work considering my collection is of objects and not basic data types like strings or ints.
Any articles, suggestions welcomed. Thanks in advance for the read.
|
|
|
|
|
I guess Reverse method will help you out.
Loading signature. Please wait...
|
|
|
|
|
Load your collection into a Stack<t> and you can just use Pop() to get them off in the order you desire; or, load the collection into a List<t> and iterate from back to front using index counting down. I'd avoid doing a Sort, but if it's a small collection resorting or reversing it may not be noticeable. Honestly, I'd use a collection that has a Count or Length property and then access it by index counting down from max index to 0. If your collection implements ICollection<t> you can load it into a List<t> via one of the overloaded constructors.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Ben Fair wrote: If your collection implements ICollection you can load it into a List via one of the overloaded constructors.
Thanks, worked like a charm.
I appreciate all the help and suggestions from everyone.
|
|
|
|
|
When adding to the collection, you can specify a key at the same time (if VB.NET) :
myCollection.add(objObject, strKey)
The key must to be unique, so the ID of the object being added will work fine. You can then get to items in the collection using the unique key:
myCollection.item(strKey)
|
|
|
|
|
We talking .Net collection?
You could use a built in system.collections.specialized collection
If you need something really fancy, create something yourself implementing iComparer and come up with ever sort you need. Do a google search on custom search iComparer.
Cheers!
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Will do,
thanks to everyone for your suggestions, they where all extremely helpful.
Cheers to the community
|
|
|
|
|
Hi.
I have a question regarding the capuring of a picture via WebCam. I searched for some samples, but none could provide on how to get the picure in its full size - megapixels.
Any help?
Regards,
Matjaž
|
|
|
|
|
That has nothing to do with VB.NET.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Someone at work told me that you can change code that would normally look like the following:
Using certainObject as new Object
Using anotherObject as New Object
Using somethingElse as new Object
'Do stuff
End Using
End Using
End Using
into this:
Using certainObject as new Object, _
anotherObject as New Object, _
somethingElse as new Object
'Do stuff
End Using
I know that VB.NET does something strange when you dimension multiple variables on the same line - ex. Dim str1, str2, str3 as String , I guess Dim str1 as String, str2 as String, str3 as String would be proper. Because of that I am unsure if it is truly proper to format the code with the second code example.
Is one more correct than the other or is this just simply a preference thing?
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Don't know about VB, but that won't work in C#.
|
|
|
|
|
CleaKO wrote: is this just simply a preference thing?
Both are correct and do the same. It is a preference thing.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
It's just a matter of preference. They both work the same, though, the nesting gives you a little more readability if you're using multiple objects and need them at different levels.
|
|
|
|
|
CleaKO wrote: Is one more correct than the other
there is no such thing as "more correct"; a statement is correct or it is not correct.
|
|
|
|
|
Technically in the example, does Object have a dispose method?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
kissdznuts wrote: does Object have a dispose method?
No, System.Object does not have a Dispose() method, so it does not implement IDisposable.
In C# you could make your own Object class, distinct from System.Object; however in VB.NET that seems not possible.
|
|
|
|