Click here to Skip to main content
15,901,284 members
Home / Discussions / C#
   

C#

 
GeneralRe: I tried to set labe control property visible to true Pin
Skynyrd23-Dec-04 5:36
Skynyrd23-Dec-04 5:36 
GeneralGetArray and SetArray Pin
SudeepPradhan21-Dec-04 18:30
SudeepPradhan21-Dec-04 18:30 
GeneralRe: GetArray and SetArray Pin
spif200121-Dec-04 19:56
spif200121-Dec-04 19:56 
GeneralRe: GetArray and SetArray Pin
SudeepPradhan21-Dec-04 20:24
SudeepPradhan21-Dec-04 20:24 
QuestionHow to AutoFit Text in a Windows Richtextbox control? Pin
AVaka21-Dec-04 17:51
AVaka21-Dec-04 17:51 
AnswerRe: How to AutoFit Text in a Windows Richtextbox control? Pin
AVaka22-Dec-04 23:13
AVaka22-Dec-04 23:13 
GeneralBetter Iteration Pin
sreejith ss nair21-Dec-04 16:47
sreejith ss nair21-Dec-04 16:47 
GeneralRe: Better Iteration Pin
Heath Stewart22-Dec-04 6:26
protectorHeath Stewart22-Dec-04 6:26 
Iteration is slow because many lookups are required (especially when you refer to a DataTable or DataRow by its string name, like dataSet1.Tables["Supplies"].Rows[0]["supplier_id"]. Either use enumeration or use a single look-up to get the right DataTable and then use that over and over again. For rows, get the current DataRow once and use that variable over and over for a single iteration (this is always a good idea for anything, anyway*). For rows, however, you'll gain more by using enumeration.

If you need faster speeds than that, then use a database. A DataSet is a poor, poor replacement for a database and is far too often used in lieu of a database.

* Other non-DataSet related bad examples I see are something like this:
foreach (SomeObject so in myObjectCollection)
{
  so.Property1.Property1 = "asdf";
  so.Property1.Property2 = 1234;
  so.Property1.Property3 = someRef;
  // ...
}
Property1 would return an object, so assign that to a local variable and reuse it. That will use far less instructions when you compile and, since it's a reference (if it were a reference, and not a value type) will use no additional memory beyond space for the pointer (32- or 64-bits - hardly measureable)

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralWeb page form controls Pin
Nosheen Iqbal21-Dec-04 16:32
Nosheen Iqbal21-Dec-04 16:32 
GeneralRe: Web page form controls Pin
Heath Stewart22-Dec-04 9:25
protectorHeath Stewart22-Dec-04 9:25 
GeneralFileSystemWatcher Pin
Rafferty Uy21-Dec-04 15:59
Rafferty Uy21-Dec-04 15:59 
GeneralRe: FileSystemWatcher Pin
Dave Kreskowiak22-Dec-04 5:47
mveDave Kreskowiak22-Dec-04 5:47 
GeneralFlash & C# Pin
mszulman21-Dec-04 9:03
sussmszulman21-Dec-04 9:03 
GeneralRe: Flash & C# Pin
Heath Stewart21-Dec-04 12:44
protectorHeath Stewart21-Dec-04 12:44 
GeneralRe: Flash & C# Pin
J4amieC21-Dec-04 22:29
J4amieC21-Dec-04 22:29 
GeneralRelation between Tables a dataset Pin
Gedrain21-Dec-04 8:57
Gedrain21-Dec-04 8:57 
GeneralRe: Relation between Tables a dataset Pin
Heath Stewart21-Dec-04 12:51
protectorHeath Stewart21-Dec-04 12:51 
GeneralRe: Relation between Tables a dataset Pin
Gedrain21-Dec-04 23:08
Gedrain21-Dec-04 23:08 
GeneralRe: Relation between Tables a dataset Pin
Heath Stewart22-Dec-04 6:18
protectorHeath Stewart22-Dec-04 6:18 
GeneralRe: Relation between Tables a dataset Pin
Gedrain22-Dec-04 7:22
Gedrain22-Dec-04 7:22 
GeneralRe: Relation between Tables a dataset Pin
Heath Stewart22-Dec-04 9:20
protectorHeath Stewart22-Dec-04 9:20 
GeneralDoubleClick and Click Events ... Left Mouse Button Pin
new_phoenix21-Dec-04 8:49
new_phoenix21-Dec-04 8:49 
GeneralRe: DoubleClick and Click Events ... Left Mouse Button Pin
Heath Stewart21-Dec-04 13:01
protectorHeath Stewart21-Dec-04 13:01 
GeneralTabPage and DataGrid - weird behavor Pin
Wjousts21-Dec-04 6:23
Wjousts21-Dec-04 6:23 
GeneralUsing WMI Pin
realmontanakid21-Dec-04 4:58
realmontanakid21-Dec-04 4:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.