求大家一个关于C#的问题~

来源:百度知道 编辑:UC知道 时间:2024/06/22 17:05:38
我的数据库表结构如下create database dbproject
on
(
name='project_data',
filename='d:\project\project_data.mdf',
size=10mb,
maxsize=50mb,
filegrowth=5mb
)
log on
(
name='project.log',
filename='d:\project\project_data.ldf',
size=5mb,
filegrowth=5mb
)
create table project
(
ProNum varchar(10) not null,
proName varchar(10) not null,
proMany int not null,
proPrice money not null,
price money not null
)
insert into project(pronum,proname,promany,proprice,price)
select '一','2006年度',2,100,200 union
select '101','1月',1,100,100 union
select '102','2月',1,100,100 union
select '二','2006年度',2,300,600 union
select '201','1月',1,300,300 union
select '202','2月',1,300,300 union
select '三','2006年度',3,50,1

你是要把全部数据一起绑定上去还是分节点层次绑定?

如果一起绑定.不会有问题的啊

-------------------------------------------------------------
那你的表结构是有问题的
你至少得再加两个字段,一个是标识ID
一个用来设置成对应关系
例如 select '一','2006年度',2,100,200 union
select '101','1月',1,100,100 union
select '102','2月',1,100,100 union
select '二','2006年度',2,300,600 union
select '201','1月',1,300,300 union
select '202','2月',1,300,300 union

就会变成
select '一','2006年度',2,100,200,1,-1 union
select '101','1月',1,100,100,2,1 union
select '102','2月',1,100,100,3,1 union
select '二','2006年度',2,300,600,4,-1 union
select '201','1月',1,300,300,5,4 union
select '202','2月',1,300,300,6,4 union

然后c#绑定那里再用总递归来实现绑定