public DataTable ModifyData(DataSet dsMod)
{
int rCount = 0;
string temp2 = "";
DataTable dtNew = new DataTable();
DataTable dt = dsMod.Tables[0];
DataRow dr;
for (int k = 0; k <= dt.Columns.Count - 1; k++)
{
string cname = dt.Columns[k].ColumnName;
dtNew.Columns.Add(cname);
}
foreach (DataRow dataRow in dt.Rows)
{
int cnt = 0;
dr = dtNew.NewRow();
dtNew.Rows.Add(dr);
foreach (DataColumn dataColumn in dt.Columns)
{
string t1 = dataRow[dataColumn].ToString();
if (Convert.ToString(dataColumn) != "Name")
{
if (t1 == "")
{
temp2 = "";
}
else
{
temp2 = clsCommon.MinutesToHours(Convert.ToInt32(t1));
}
}
else
{
temp2 = t1;
}
dtNew.Rows[rCount][cnt] = temp2.ToString();
cnt++;
}
rCount++;
}
return dtNew;
}
Compare Sql Server Table Constraints
13 years ago
0 comments:
Post a Comment