/****** object: table [dbo].[users] script date: 2004-01-08 0:46:36 ******/ create table [dbo].[users] ( [id] [int] identity (1, 1) not null , [truename] [char] (20) not null , [regname] [char] (20) not null , [pwd] [char] (10) not null , [sex] [char] (2) null , [email] [char] (20) null ) on [primary] go
alter table [dbo].[customers] with nocheck add constraint [pk_customers] primary key nonclustered ( [customerid] ) on [primary] go
alter table [dbo].[users] with nocheck add constraint [pk_users] primary key nonclustered ( [id] ) on [primary] go
(2)創(chuàng)建業(yè)務實體層 1.打開vs.net2002,新建一個項目,選asp.net web服務,位置是: http://localhost/mydotnet/tiner/webdata/ 2.webservice的代碼 using system; using system.collections; using system.componentmodel; using system.data; using system.data.sqlclient; using system.diagnostics; using system.web; using system.web.services; using system.web.ui; using system.web.ui.webcontrols; using system.web.ui.htmlcontrols;
添加引用后,如下圖: 好了,我們開始寫代碼,詳細代碼如下: using system; using system.collections; using system.componentmodel; using system.data; using system.drawing; using system.web; using system.web.sessionstate; using system.web.ui; using system.web.ui.webcontrols; using system.web.ui.htmlcontrols; using system.data.sqlclient;