另,我用c#语言开发的
9 个解决方案
#1
查询出来的结果放在table中,再写入新表
#2
具体怎样个不同呢?你想怎样放到一张表中?
#3
遍历数据集
DataRow dr=ds.Tables[0].NewRow();
dr[0]=0;
dr[1]="";
ds.Tables[0].Rows.InsertAt(dr,0);
insert into .. select a,b from tb
DataRow dr=ds.Tables[0].NewRow();
dr[0]=0;
dr[1]="";
ds.Tables[0].Rows.InsertAt(dr,0);
insert into .. select a,b from tb
#4
insert into newtable(tem1,tem2,...)
select cast(tem1 as int),cast(tem2 as nvarchar(100)),...)from oldtable
#5
绑定新数据前,清空旧数据
GridView前台设置AutoGenerateColumns=true;
GridView前台设置AutoGenerateColumns=true;
#6
构造新的DataSet,代码如下
public DataTable createDataset1(string uid)//排序方式和排序字段
{
DataSet ds = new DataSet();
ds = BLL_Expert.selectUserModel(uid);
int count = ds.Tables[0].Rows.Count;
DataTable dtold = ds.Tables[0];
DataTable dt = new DataTable("linshi");
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("intUserId", typeof(int));
dt.Columns.Add("strCompanyName", typeof(string));
dt.Columns.Add("worker", typeof(string));
dt.Columns.Add("bcEndOut", typeof(double));
dt.Columns.Add("endOutPoint", typeof(double));
dt.Columns.Add("avgPoint1", typeof(double));
dt.Columns.Add("isPass", typeof(int));
dr["id"] = id;
dr["intUserId"] = intUserId;
dr["strCompanyName"] = strCompanyName;
dr["worker"] = worker;
dr["bcEndOut"] = bcEndOut;
dr["endOutPoint"] = endOutPoint;
dr["isPass"] = isPass;
dr["avgPoint1"] = "0";
DataView dv = dt.DefaultView; dt = dv.ToTable();
return dt;
}
public DataTable createDataset1(string uid)//排序方式和排序字段
{
DataSet ds = new DataSet();
ds = BLL_Expert.selectUserModel(uid);
int count = ds.Tables[0].Rows.Count;
DataTable dtold = ds.Tables[0];
DataTable dt = new DataTable("linshi");
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("intUserId", typeof(int));
dt.Columns.Add("strCompanyName", typeof(string));
dt.Columns.Add("worker", typeof(string));
dt.Columns.Add("bcEndOut", typeof(double));
dt.Columns.Add("endOutPoint", typeof(double));
dt.Columns.Add("avgPoint1", typeof(double));
dt.Columns.Add("isPass", typeof(int));
dr["id"] = id;
dr["intUserId"] = intUserId;
dr["strCompanyName"] = strCompanyName;
dr["worker"] = worker;
dr["bcEndOut"] = bcEndOut;
dr["endOutPoint"] = endOutPoint;
dr["isPass"] = isPass;
dr["avgPoint1"] = "0";
DataView dv = dt.DefaultView; dt = dv.ToTable();
return dt;
}
#7
你能告诉我BLL_Expert是什么意思吗?
#8
BLL是引用数据访问层的代码
#9
这个思路应该就可以。
#1
查询出来的结果放在table中,再写入新表
#2
具体怎样个不同呢?你想怎样放到一张表中?
#3
遍历数据集
DataRow dr=ds.Tables[0].NewRow();
dr[0]=0;
dr[1]="";
ds.Tables[0].Rows.InsertAt(dr,0);
insert into .. select a,b from tb
DataRow dr=ds.Tables[0].NewRow();
dr[0]=0;
dr[1]="";
ds.Tables[0].Rows.InsertAt(dr,0);
insert into .. select a,b from tb
#4
insert into newtable(tem1,tem2,...)
select cast(tem1 as int),cast(tem2 as nvarchar(100)),...)from oldtable
#5
绑定新数据前,清空旧数据
GridView前台设置AutoGenerateColumns=true;
GridView前台设置AutoGenerateColumns=true;
#6
构造新的DataSet,代码如下
public DataTable createDataset1(string uid)//排序方式和排序字段
{
DataSet ds = new DataSet();
ds = BLL_Expert.selectUserModel(uid);
int count = ds.Tables[0].Rows.Count;
DataTable dtold = ds.Tables[0];
DataTable dt = new DataTable("linshi");
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("intUserId", typeof(int));
dt.Columns.Add("strCompanyName", typeof(string));
dt.Columns.Add("worker", typeof(string));
dt.Columns.Add("bcEndOut", typeof(double));
dt.Columns.Add("endOutPoint", typeof(double));
dt.Columns.Add("avgPoint1", typeof(double));
dt.Columns.Add("isPass", typeof(int));
dr["id"] = id;
dr["intUserId"] = intUserId;
dr["strCompanyName"] = strCompanyName;
dr["worker"] = worker;
dr["bcEndOut"] = bcEndOut;
dr["endOutPoint"] = endOutPoint;
dr["isPass"] = isPass;
dr["avgPoint1"] = "0";
DataView dv = dt.DefaultView; dt = dv.ToTable();
return dt;
}
public DataTable createDataset1(string uid)//排序方式和排序字段
{
DataSet ds = new DataSet();
ds = BLL_Expert.selectUserModel(uid);
int count = ds.Tables[0].Rows.Count;
DataTable dtold = ds.Tables[0];
DataTable dt = new DataTable("linshi");
dt.Columns.Add("id", typeof(string));
dt.Columns.Add("intUserId", typeof(int));
dt.Columns.Add("strCompanyName", typeof(string));
dt.Columns.Add("worker", typeof(string));
dt.Columns.Add("bcEndOut", typeof(double));
dt.Columns.Add("endOutPoint", typeof(double));
dt.Columns.Add("avgPoint1", typeof(double));
dt.Columns.Add("isPass", typeof(int));
dr["id"] = id;
dr["intUserId"] = intUserId;
dr["strCompanyName"] = strCompanyName;
dr["worker"] = worker;
dr["bcEndOut"] = bcEndOut;
dr["endOutPoint"] = endOutPoint;
dr["isPass"] = isPass;
dr["avgPoint1"] = "0";
DataView dv = dt.DefaultView; dt = dv.ToTable();
return dt;
}
#7
你能告诉我BLL_Expert是什么意思吗?
#8
BLL是引用数据访问层的代码
#9
这个思路应该就可以。