在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
public string dstotring(DataSet ds, int cursor) { if (ds.Tables[0].Rows.Count > 0) { int count = ds.Tables[0].Rows.Count; string Caption = string.Empty; StringBuilder sb = new StringBuilder(); for (int i = 0; i < count; i++) { sb.Append(ds.Tables[0].Rows[i][0].ToString()).Append(","); } Caption = sb.ToString(); StringBuilder sb2 = new StringBuilder(); for (int i = 0; i < Caption.Length; i += cursor) { if (i + cursor > Caption.Length) { cursor = Caption.Length - i; sb2.Append(Caption.Substring(i, cursor)); } else { sb2.AppendLine(Caption.Substring(i, cursor)); } } return sb2.ToString(); } return string.Empty; }
|
请发表评论