Click here to Skip to main content
15,908,115 members
Home / Discussions / Database
   

Database

 
GeneralRe: Connection Object Pin
EdbertP13-Oct-04 17:17
EdbertP13-Oct-04 17:17 
GeneralUnicode to Big-5 conversion (Any ideas?) Pin
Its due when11-Oct-04 20:06
Its due when11-Oct-04 20:06 
Generalexcel and oledbexception Pin
its_skar11-Oct-04 15:34
its_skar11-Oct-04 15:34 
QuestionUnforseen problem? Pin
Jerry Hammond11-Oct-04 5:50
Jerry Hammond11-Oct-04 5:50 
AnswerRe: Unforseen problem? Pin
Colin Angus Mackay11-Oct-04 6:05
Colin Angus Mackay11-Oct-04 6:05 
GeneralRe: Unforseen problem? Pin
Mike Dimmick11-Oct-04 9:59
Mike Dimmick11-Oct-04 9:59 
GeneralRe: Unforseen problem? Pin
Colin Angus Mackay11-Oct-04 10:08
Colin Angus Mackay11-Oct-04 10:08 
GeneralRe: Unforseen problem? Pin
Mike Dimmick11-Oct-04 10:31
Mike Dimmick11-Oct-04 10:31 
This program:
public class ConcatTest
{
   public static void Main(string[] args)
   {
      string x = args[0] + args[1] + args[2] + args[3];
   }
}
when compiled csc /t:exe ConcatTest.cs produces the following IL (from Reflector[^]):
.method public hidebysig static void Main(string[] args) cil managed
{
      .entrypoint
      // Code Size: 19 byte(s)
      .maxstack 5
      .locals (
            string text1)
      L_0000: ldarg.0 
      L_0001: ldc.i4.0 
      L_0002: ldelem.ref 
      L_0003: ldarg.0 
      L_0004: ldc.i4.1 
      L_0005: ldelem.ref 
      L_0006: ldarg.0 
      L_0007: ldc.i4.2 
      L_0008: ldelem.ref 
      L_0009: ldarg.0 
      L_000a: ldc.i4.3 
      L_000b: ldelem.ref 
      L_000c: call string string::Concat(string, string, string, string)
      L_0011: stloc.0 
      L_0012: ret 
}
(I was going to post the decompiled C# code but damn me if Reflector doesn't convert it back the other way!)

The four-argument version of Concat can also be examined in Reflector: it calls an internal method FastStringAllocate with the combined lengths of the four strings then makes four calls to the internal method FillStringChecked. If you want to know what's in those, look at the Shared Source CLI[^] - it's supposed to be a slightly cut-down version of the full Framework. Certainly the internal method names are the same!

Now, if you don't know how many strings you want to concatenate, a StringBuilder is probably better (e.g. for building a string in a loop). If you always have a fixed number of strings, Concat may be better. If you're concatenating literal strings, the C# compiler does the concatenation at compile-time.

Stability. What an interesting concept. -- Chris Maunder
QuestionAre distributed transactions in MS Access possible ? Pin
Daniel Kailer11-Oct-04 4:13
Daniel Kailer11-Oct-04 4:13 
AnswerRe: Are distributed transactions in MS Access possible ? Pin
Vasudevan Deepak Kumar13-Oct-04 2:36
Vasudevan Deepak Kumar13-Oct-04 2:36 
Generalmysql with asp.net Pin
hazzem elrefai11-Oct-04 1:48
hazzem elrefai11-Oct-04 1:48 
GeneralRe: mysql with asp.net Pin
Colin Angus Mackay11-Oct-04 2:33
Colin Angus Mackay11-Oct-04 2:33 
GeneralRe: mysql with asp.net Pin
Gavin Jeffrey11-Oct-04 3:27
Gavin Jeffrey11-Oct-04 3:27 
GeneralRe: mysql with asp.net Pin
Vasudevan Deepak Kumar13-Oct-04 2:35
Vasudevan Deepak Kumar13-Oct-04 2:35 
GeneralSQL query required Pin
Imtiaz Murtaza10-Oct-04 1:54
Imtiaz Murtaza10-Oct-04 1:54 
GeneralRe: SQL query required Pin
suzyb11-Oct-04 1:04
suzyb11-Oct-04 1:04 
GeneralRe: SQL query required Pin
Michael Potter11-Oct-04 3:18
Michael Potter11-Oct-04 3:18 
GeneralRe: SQL query required Pin
mysorian14-Oct-04 18:38
professionalmysorian14-Oct-04 18:38 
GeneralMemo field not returning more than 256 characters. Pin
brdavid9-Oct-04 8:26
brdavid9-Oct-04 8:26 
GeneralRe: Memo field not returning more than 256 characters. Pin
Nemanja Trifunovic9-Oct-04 8:36
Nemanja Trifunovic9-Oct-04 8:36 
GeneralRe: Memo field not returning more than 256 characters. Pin
brdavid9-Oct-04 12:13
brdavid9-Oct-04 12:13 
GeneralRe: Memo field not returning more than 256 characters. Pin
EdbertP11-Oct-04 20:43
EdbertP11-Oct-04 20:43 
GeneralRe: Memo field not returning more than 256 characters. Pin
brdavid12-Oct-04 0:26
brdavid12-Oct-04 0:26 
GeneralRe: Memo field not returning more than 256 characters. Pin
EdbertP12-Oct-04 14:31
EdbertP12-Oct-04 14:31 
Generalmssql : INFORMATION_SHEMA.COLUMNS DATA_TYPE problem Pin
frakk9-Oct-04 3:38
frakk9-Oct-04 3:38 

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.