Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a dataset to code-behind
Message
De
25/11/2003 09:59:43
Mindy Shingara
Central Susquehanna Intermediate Unit
Lewisburg, Pennsylvanie, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Returning a dataset to code-behind
Divers
Thread ID:
00853281
Message ID:
00853281
Vues:
51
I am running through a chunk of code within a class and I want to return the value of the variable, l_cdesc, to my code-behind. I can only return a DataSet from a class to code-behind via OLEdb, however, the string, l_cdesc, is all I want to return. I can see the correct string value I want when I look at l_cdesc in debugger, but how can I return it to my code-behind? Here is my code....I know I can't return (l_cdesc) as it's written now.

All the DataTables are created before this and they do contain the correct data.....

string l_cdesc = "";;
// Fund
if (dt1.Rows.Count > 0)
{
l_cdesc = dt1.Rows[0]["de_desc"].ToString();
}
// Function
if (dt2.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt2.Rows[0]["de_desc"].ToString();
}
// Object
if (dt3.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt3.Rows[0]["de_desc"].ToString();
}
// Fundsrc
if (dt4.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt4.Rows[0]["de_desc"].ToString();
}
// Instructional Org
if (dt5.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt5.Rows[0]["de_desc"].ToString();
}
// Operational Unit
if (dt6.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt6.Rows[0]["de_desc"].ToString();
}
// Subject Matter
if (dt7.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt7.Rows[0]["de_desc"].ToString();
}
// Job Class
if (dt8.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt8.Rows[0]["de_desc"].ToString();
}
// Special Cost Center
if (dt9.Rows.Count > 0)
{
l_cdesc = l_cdesc + " " + dt9.Rows[0]["de_desc"].ToString();
}

return this.GetDataSet( l_cdesc);
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform