Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Concatenating from SQL
Message
From
09/09/2004 08:33:44
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
 
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00940548
Message ID:
00940557
Views:
25
>Hi, Bill,
>
>Not sure about the specifics of what you're looking to do, but here's a basic example that loops through the rows of a datatable and appends to a string variable:
>
>
>string cText = "";
>foreach(DataRow Dr in MyDataSet.Tables["myTable"].Rows)
>   cText += Dr["MyColumn"].ToString().Trim();
>
>
>Does that help?
>
>Kevin


Kevin,

That worked - almost. I am still encountering a problem.

How would I declare the DataRow?

I am receiving the following:

c:\inetpub\wwwroot\PMR\EditDoc.aspx.cs(128): 'DrComment' conflicts with the declaration 'PMR.EditDoc.DrComment'

from this code:

CmntDisp = "";
foreach(DataRow DrComment in dsComments.Tables["PMRCmment"].Rows);
CmntDisp += DrComment["Comments"].ToString().Trim();


I am declaring it as:

private DataRow DrComment;


Any ideas?
Bill Benton
Senior Systems Analyst
Nuvell Financial Services
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform