Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataView/DataSet/DataReader
Message
From
09/01/2007 13:28:04
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
 
 
To
09/01/2007 13:13:32
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01183234
Message ID:
01183875
Views:
37
>>sDispStr += TRow["field1"].ToString() + ", " + TRow["field2"].ToString() + " – " + TRow["field3"].ToString() + TRow["field4"].ToString() + "\n";
>
>
>You know you don't need the toString() on these to concatenate the fields. There is an explicit cast to string automatically. The same happens with numerics and dates.

I know John I usually use VB.NET and I always have strict option on so there is no implicite cast, you always have to cast to whatever type you want, so that line in VB.NET would be.
sDispStr += TRow("field1").ToString() + ", " + TRow("field2").ToString() + " – " + TRow("field3").ToString() + TRow("field4").ToString() + vbCRLF or
sDispStr += CStr(TRow("field1")) + ", " + CStr(TRow("field2")) + " – " + CStr(TRow("field3")) + CStr(TRow("field4")) + vbCRLF
Alexandre Palma
Senior Application Architect
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform