asp.net 멤버십에 익숙하지 않음 & 프로그래밍 방식으로 연결 문자열을 변경하려면 도움이 필요합니다.멤버십 연결 문자열 변경
지금까지 시도 내가 네임 스페이스와 같은 수준의 프로젝트 이름 샘플 **을 만들 수 있습니다
하고
namespace Sample
{
public class Connectionstring : SqlMembershipProvider
{
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{
string connectionString = "server=xx.xx.xx;database=db;user id=un;password=pwd";
// Set private property of Membership provider.
FieldInfo connectionStringField = GetType().BaseType
.GetField("_sqlConnectionString", BindingFlags.Instance |
BindingFlags.NonPublic);
connectionStringField.SetValue(this, connectionString);
}
}
}
및 변경된 웹 설정 파일로 System.Web.Security.SqlMembershipProvider
코드를 확장 한 무엇 회원 태그는
<membership defaultProvider="SQLMembershipProvider">
<providers>
<add name="SQLMembershipProvider" type="sample.Connectionstring,sample" connectionStringName="SQLMembershipConnString" applicationName="@@@@@@@" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" />
</providers>
</membership>
으로, r 웹 응용 프로그램 프로젝트를 unning 변경 나는 연결 문자열이 변경되지 않습니다?
당신이 웹 설정에서 연결 문자열을 사용하지 않는 여러분의 소중한 답변과 의견 어떤 이유로
호기심 때문에 왜이 작업을 수행해야합니까? – Alyce
@Alyce 내 일은 그 테이블에 대한 사용자를 생성하고 내부 데이터베이스를 입력하는 사용자를 기반으로 명령을 실행하는 것입니다. – GowthamanSS
안녕하세요. http://forums.asp.net/t/997608에 도움이 될만한 링크를 찾으십시오.aspx/1/10 – Niventh