欢迎来到 unity 学习 、 unity 培训 、 unity 企业培训 教育专区,这里有很多 U3D 资源 、 U3D 培训视频 U3D 教 程、 U3D 常见问题 、 U3D 项目源码, 我们致力于打造业内 unity3d 培训 、学习第一品牌
数据库的一些基本操作
--建表
create table market(
id int primary key identity(1,1),
name varchar(50),
password varchar(50)
)
--查询
select*from shop
select*from users
select*from usershop
--删除一行数据
delete from shop where name='袜子'
--添加一条数据
insert into shop values ('裤子',100,100)
--修改一条数据
update shop set price =20 where id='1'
--多表的查询
select users.name,shop.name , usershop.number from usershop inner join users on users.id =usershop .sid inner join shop on usershop.uid =shop.id
--批量的向表中插入数据
insert into shop(name,price,number)
select'鞋子','100','50'union
select'裤擦宗子','100','50'
迭代器的格式
ArrayList list = new usershopping().show();
IEnumerator it = list.GetEnumerator();
while (it.MoveNext())
{
user e = (user)it.Current;
it.MoveNext();
Shop e2 = (Shop )it.Current;
it.MoveNext();
usershopping g = (usershopping )it.Current;
Console.WriteLine(e.Name +" "+e2.Name +" "+g.Number );
}