How to get a list of names from database into string array?
variable name should be string array...
This is the code I use...
public string GetFunctionName (Guid UserID)
{
sSelect = "";
string name="";
if (db!=null)
{
if (nGroupID.Lengt h !=0)
{
for ( int iIndex = 0; iIndex < nGroupID.Length ; iIndex++ )
{
if ( iIndex != 0 )
sSelect += " OR ";
sSelect += "GroupID ='" + nGroupID[ iIndex ].ToString () + "'";
}
DataRow[] FGrows = db.dataSetUsers .FunctionsGroup s.Select(sSelec t);
foreach (DataSetUsers.F unctionsGroupsR ow row in FGrows)
{
DataSetUsers.Fu nctionsRow function =
db.dataSetUsers .Functions.Find ByFunctionID( row.FunctionID );
name = function.Name ;
}
}
}
return name;
}
variable name should be string array...
This is the code I use...
public string GetFunctionName (Guid UserID)
{
sSelect = "";
string name="";
if (db!=null)
{
if (nGroupID.Lengt h !=0)
{
for ( int iIndex = 0; iIndex < nGroupID.Length ; iIndex++ )
{
if ( iIndex != 0 )
sSelect += " OR ";
sSelect += "GroupID ='" + nGroupID[ iIndex ].ToString () + "'";
}
DataRow[] FGrows = db.dataSetUsers .FunctionsGroup s.Select(sSelec t);
foreach (DataSetUsers.F unctionsGroupsR ow row in FGrows)
{
DataSetUsers.Fu nctionsRow function =
db.dataSetUsers .Functions.Find ByFunctionID( row.FunctionID );
name = function.Name ;
}
}
}
return name;
}
Comment