如何创建一个ASPNET.mdf文件? [英] how to create an ASPNET.mdf file?

查看:69
本文介绍了如何创建一个ASPNET.mdf文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在为匿名用户构建一个Web应用程序。他们可以在网站上查看

,仅此而已。为了执行其他操作,必须记录匿名

用户。所以我使用CreateUserWizard

控件创建一个aspx页面。用户可以填写他的用户名,密码等....


我的问题是:当用户填写所有内容并点击按钮时创建一个

帐号,没有任何反应(没有错误,但没有创建用户帐户)。

我认为asp.net会在App_Data中创建一个ASPNET.MDF文件,用于存储

用户和会员信息并自动添加新连接

web.config中的字符串。但它不会发生。


我知道我可以进入设计模式(n VWD)并点击管理网站,

但所有用户都是匿名的,所以我不能提前创建用户。

我是否必须在web.config中添加一些配置代码?或其他什么?


感谢您的帮助

Mich

解决方案

运行aspnet_regsql.exe来自.Net Framework 2.0目录中的命令窗口。


Juan T. Llibre,asp.net MVP

asp。 net faq: http://asp.net.do/faq/

foros de asp.net,en espa?ol: http:// asp.net.do/foros/

============================== =====

" Mich" < mi ** @ nm.dfwrote in message news:Og **************** @ TK2MSFTNGP03.phx.gbl ...





我正在为匿名用户构建一个Web应用程序。他们可以在网站上看看,没有什么比这更好的了。要执行其他操作,必须记录匿名用户。所以我使用CreateUserWizard控件创建一个aspx

页面。用户可以填写他的用户名,密码等....


我的问题是:当用户填写所有内容并点击按钮创建帐户时,没有什么

发生(没有错误,但没有创建用户帐户)。

我认为asp.net会在App_Data中创建一个用于存储用户和会员的ASPNET.MDF文件

信息并在web.config中自动添加新的连接字符串。但它不会发生。


我知道我可以进入设计模式(n VWD)并点击管理网站,但所有用户都是

匿名,所以我不能提前创建用户。

我是否必须在web.config中添加一些配置代码?或其他什么?


感谢您的帮助

Mich



Juan,谢谢你的回复..


我做了这个,并在sql server

目录中创建了一个mdf文件ASPNETDB.MDF。

所以我将这两个文件(mdf和log)复制到我的应用程序的APP_Data中。

我在web.config中添加了一个连接字符串,如下所示:

< ; add name =" aspnetdb" connectionString =" Data

Source = .\SQLEXPRESS; AttachDbFilename = | DataDirector y | \ASPNETDB.MDF; Integrated

Security = True; User Instance = True" providerName =" System.Data.SqlClient" />


现在,当启动包含createuserwizard的aspx页面并再次填写

所有texbox时,没有任何反应(用户未创建)。如果我在VWDev中尝试
,则会创建用户。

我忘了或做错了什么?

谢谢


" Juan T. Llibre" < no *********** @ nowhere.comschreef in bericht

news:ut ************** @ TK2MSFTNGP05.phx。 gbl ...


从.Net Framework 2.0

目录的命令窗口运行aspnet_regsql.exe。



Juan T. Llibre,asp.net MVP

asp.net faq: http://asp.net.do/faq/

foros de asp.net,en espa?ol: http://asp.net.do/foros/

= ==================================

" Mich" < mi ** @ nm.dfwrote in message

news:Og **************** @ TK2MSFTNGP03.phx.gbl ...


>

我正在为匿名用户构建一个Web应用程序。他们可以在网站上看一下
,仅此而已。为了执行其他操作,必须记录
匿名用户。所以我使用
CreateUserWizard控件创建一个aspx页面。用户可以填写他的用户名,密码等
....

我的问题是:当用户填写所有内容并点击按钮创建帐户时,没有发生了(没有错误,但没有创建用户帐户)。
我认为asp.net会在App_Data中创建一个ASPNET.MDF文件,用于存储
用户和会员信息并自动添加新连接
web.config中的字符串。但它不会发生。

我知道我可以进入设计模式(n VWD)并点击管理
网站,但所有用户都是匿名的,所以我无法提前创建用户。
我是否必须在web.config中添加一些配置代码?或其他什么?

感谢您的帮助
Mich




我注意到你集成了安全性而不是用户名和密码。

我可能错了,但我认为集成安全性需要当前用户

才能拥有数据库中的权限。当你通过VWDev进行操作时,你的b $ b可能带有你的用户名,但是从ASP.NET执行时,

你使用的是ASP.NET用户帐户,可能没有许可。


-

祝你好运,

Dave Colliver。
http://www.AshfieldFOCUS.com

~~
http://www.FOCUSPortals.com - 提供本地特许经营权

Mich < mi ** @ nm.dfwrote in message

news:Ox **************** @ TK2MSFTNGP05.phx.gbl ...


嗨Juan,谢谢你的回复..


我做了这个,并在sql server中创建了一个mdf文件ASPNETDB.MDF

目录。

所以我将这两个文件(mdf和log)复制到我的应用程序的APP_Data中。

我在web.config中添加了一个连接字符串像这样:

< add name =" aspnetdb" connectionString =" Data

Source = .\SQLEXPRESS; AttachDbFilename = | DataDirector y | \ASPNETDB.MDF; Integrated

Security = True; User Instance = True" providerName =" System.Data.SqlClient" />


现在,当启动包含createuserwizard的aspx页面和

再次填充所有texbox时,没有任何反应(用户未创建)。如果我在VWDev中尝试
,则会创建用户。

我忘了或做错了什么?

谢谢


" Juan T. Llibre" < no *********** @ nowhere.comschreef in bericht

news:ut ************** @ TK2MSFTNGP05.phx。 gbl ...


>从.Net Framework 2.0
目录的命令窗口运行aspnet_regsql.exe。


Juan T. Llibre,asp.net MVP
asp.net faq: http://asp.net.do/faq/
foros de asp.net,en espa?ol: http://asp.net.do/foros/
=================== ================
密歇根 < mi ** @ nm.dfwrote in message
新闻:Og **************** @ TK2MSFTNGP03.phx.gbl ...


>>

我正在为匿名用户构建一个Web应用程序。他们可以在网站上看一下,仅此而已。为了执行其他操作,必须记录匿名用户。所以我使用
CreateUserWizard控件创建一个aspx页面。用户可以填写他的用户名,密码等
....

我的问题是:当用户填写所有内容并点击按钮
创建帐户时,没有发生了(没有错误,但没有创建用户帐户)。
我认为asp.net会在App_Data中创建一个ASPNET.MDF文件,用于存储用户和会员信息并自动添加新的< web.config中的连接字符串。但它不会发生。

我知道我可以进入设计模式(n VWD)并点击管理
网站,但所有用户都是匿名的,所以我无法提前创建用户。
我是否必须在web.config中添加一些配置代码?或其他什么?

感谢您的帮助
Mich





Hi,

i''m building an web application for anonymous users. They can take a look in
the website, nothing more. In order to perform other actions, the anonymous
user must be logged. So i create an aspx page with the CreateUserWizard
control. The user can fill his username, password etc ....

My problem is: when an user fills everything and clicks on button "create an
account", nothing happens (no error, but no user account created).
I thought asp.net would create in App_Data an ASPNET.MDF file for storing
user and membership information and add automatically a new connection
string in web.config. But it doesn''t happen.

I know i can go in design mode (n VWD) and click on "administer the site",
but all the users are anonymous, so i can''t create user in advance.
Do i have to put some configuration code in web.config? Or something else?

Thanks for help
Mich

解决方案

Run aspnet_regsql.exe from a command window in your .Net Framework 2.0 directory.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
===================================
"Mich" <mi**@nm.dfwrote in message news:Og****************@TK2MSFTNGP03.phx.gbl...

Hi,

i''m building an web application for anonymous users. They can take a look in the website, nothing
more. In order to perform other actions, the anonymous user must be logged. So i create an aspx
page with the CreateUserWizard control. The user can fill his username, password etc ....

My problem is: when an user fills everything and clicks on button "create an account", nothing
happens (no error, but no user account created).
I thought asp.net would create in App_Data an ASPNET.MDF file for storing user and membership
information and add automatically a new connection string in web.config. But it doesn''t happen.

I know i can go in design mode (n VWD) and click on "administer the site", but all the users are
anonymous, so i can''t create user in advance.
Do i have to put some configuration code in web.config? Or something else?

Thanks for help
Mich



Hi Juan, thanks for replying..

I did this and an mdf file ASPNETDB.MDF was created in the sql server
directory.
So i copied both files (mdf and log) into APP_Data of my application.
I added a connection string in web.config like this:
<add name="aspnetdb" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

Now, when starting the aspx page containing the createuserwizard and filling
all texboxes, again, nothing happens (user is not created). If i try it
within VWDev., the user is then created.
What do i forget or do wrong?
Thanks

"Juan T. Llibre" <no***********@nowhere.comschreef in bericht
news:ut**************@TK2MSFTNGP05.phx.gbl...

Run aspnet_regsql.exe from a command window in your .Net Framework 2.0
directory.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
===================================
"Mich" <mi**@nm.dfwrote in message
news:Og****************@TK2MSFTNGP03.phx.gbl...

>Hi,

i''m building an web application for anonymous users. They can take a look
in the website, nothing more. In order to perform other actions, the
anonymous user must be logged. So i create an aspx page with the
CreateUserWizard control. The user can fill his username, password etc
....

My problem is: when an user fills everything and clicks on button "create
an account", nothing happens (no error, but no user account created).
I thought asp.net would create in App_Data an ASPNET.MDF file for storing
user and membership information and add automatically a new connection
string in web.config. But it doesn''t happen.

I know i can go in design mode (n VWD) and click on "administer the
site", but all the users are anonymous, so i can''t create user in
advance.
Do i have to put some configuration code in web.config? Or something
else?

Thanks for help
Mich




I notice you ahve integrated security rather than user names and passwords.
I may be wrong but I think integrated security will require the current user
to have permission in the database. When you are doing it through VWDev, you
are probably carrying your username through, but when doing it from ASP.NET,
you are using the ASP.NET user account, which may not have permission.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Mich" <mi**@nm.dfwrote in message
news:Ox****************@TK2MSFTNGP05.phx.gbl...

Hi Juan, thanks for replying..

I did this and an mdf file ASPNETDB.MDF was created in the sql server
directory.
So i copied both files (mdf and log) into APP_Data of my application.
I added a connection string in web.config like this:
<add name="aspnetdb" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

Now, when starting the aspx page containing the createuserwizard and
filling all texboxes, again, nothing happens (user is not created). If i
try it within VWDev., the user is then created.
What do i forget or do wrong?
Thanks

"Juan T. Llibre" <no***********@nowhere.comschreef in bericht
news:ut**************@TK2MSFTNGP05.phx.gbl...

>Run aspnet_regsql.exe from a command window in your .Net Framework 2.0
directory.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espa?ol : http://asp.net.do/foros/
===================================
"Mich" <mi**@nm.dfwrote in message
news:Og****************@TK2MSFTNGP03.phx.gbl...

>>Hi,

i''m building an web application for anonymous users. They can take a
look in the website, nothing more. In order to perform other actions,
the anonymous user must be logged. So i create an aspx page with the
CreateUserWizard control. The user can fill his username, password etc
....

My problem is: when an user fills everything and clicks on button
"create an account", nothing happens (no error, but no user account
created).
I thought asp.net would create in App_Data an ASPNET.MDF file for
storing user and membership information and add automatically a new
connection string in web.config. But it doesn''t happen.

I know i can go in design mode (n VWD) and click on "administer the
site", but all the users are anonymous, so i can''t create user in
advance.
Do i have to put some configuration code in web.config? Or something
else?

Thanks for help
Mich





这篇关于如何创建一个ASPNET.mdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆