Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Concatenating from SQL
Message
De
09/09/2004 08:33:44
Bill Benton
North Florida Software Services
Middleburg, Floride, États-Unis
 
 
À
09/09/2004 08:08:42
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00940548
Message ID:
00940557
Vues:
24
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform