ASP.NET web forms Login control SQL Server data binding?

故事扮演 提交于 2021-01-28 21:37:59

问题


I'm trying build web form with login control. Normally when you drag and drop Login control on aspx form, Visual Studio creates ASPNETDB.MDF database in App_Data folder. In my case it didn't create. So I've created ASPNETDB database within my SQL server using aspnet_regsql tool. Also I have Sql Connection String ("myCS") in web.config file, which connected to my ASPNETDB database in SQL server:

<add name="myCS" connectionString="Server=myserver; Database=ASPNETDB; Persist Security Info=True ;User ID=sa; Password=sa" providerName="System.Data.SqlClient"/>

By default my login control has not data binding with SQL server.

My questions are:

  1. How to bind Login Control with SQL database?
  2. Should I create DataSource and define each field manually?
  3. (This question is not related to two upper questions) How Visual Studio binds login control with local ASPNETDB.MDF database when you drag and drop login control on web form? Where it stores binding code, so I could use it as template?

来源:https://stackoverflow.com/questions/41042861/asp-net-web-forms-login-control-sql-server-data-binding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!