1.create a database
a.create new database
(1)right click [Database] and click [New Database]
(2)set a name for this database (ex:newdb)
(3)check [Use full-text indexing]
(4)click [ok] to finish.
b.create new user
(1)open [security]
(2)right click [logins] and click [new login]
(3)set a name for this login (ex:newlogin)
(4)choose [sql server authentication], set and confirm a password
(5)uncheck [enforce password policy]
(6)choose (newdb) at [default database]
(7)at [select a page] item
(a)click [user mapping]
(b)check (newdb) and check [db_owner] for [database role membership for:newdb]
(8)click [ok] to finish.
2.if you want use web login
a.run [C:\WINDOWS\Microsoft.NET\Framework\v2.0.????\aspnet_regsql.exe]
b.click [next] to choose [configure sql server for application services] and click [next] again
c.set [server] address
d.choose [sql server authentication], set [user name](newlogin) and [password]
e.set database name(newdb) at [database]
f.click [next] and agaion to begin insert sql data
g.click [finish] to finish.
3.project sql connect
a.open [web.config] and edit
b.find [<connectionstrings>......]
c.modify and replace [<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=(sqlserverhost);Initial Catalog=(newdb);Persist Security Info=True;User ID=(newlogin);Password=(***********)"
providerName="System.Data.SqlClient" />
</connectionStrings>]
d.close and save
e.run vs and open project, click [asp.net config] to config
f.click [security] create user , and enable role and create role to begin
沒有留言:
張貼留言