Top-Themen

AppleEntwicklungHardwareInternetLinuxMicrosoftMultimediaNetzwerkeOff TopicSicherheitSonstige SystemeVirtualisierungWeiterbildungZusammenarbeit

Aktuelle Themen

Administrator.de FeedbackApache ServerAppleAssemblerAudioAusbildungAuslandBackupBasicBatch & ShellBenchmarksBibliotheken & ToolkitsBlogsCloud-DiensteClusterCMSCPU, RAM, MainboardsCSSC und C++DatenbankenDatenschutzDebianDigitiales FernsehenDNSDrucker und ScannerDSL, VDSLE-BooksE-BusinessE-MailEntwicklungErkennung und -AbwehrExchange ServerFestplatten, SSD, RaidFirewallFlatratesGoogle AndroidGrafikGrafikkarten & MonitoreGroupwareHardwareHosting & HousingHTMLHumor (lol)Hyper-VIconsIDE & EditorenInformationsdiensteInstallationInstant MessagingInternetInternet DomäneniOSISDN & AnaloganschlüsseiTunesJavaJavaScriptKiXtartKVMLAN, WAN, WirelessLinuxLinux DesktopLinux NetzwerkLinux ToolsLinux UserverwaltungLizenzierungMac OS XMicrosoftMicrosoft OfficeMikroTik RouterOSMonitoringMultimediaMultimedia & ZubehörNetzwerkeNetzwerkgrundlagenNetzwerkmanagementNetzwerkprotokolleNotebook & ZubehörNovell NetwareOff TopicOpenOffice, LibreOfficeOutlook & MailPapierkorbPascal und DelphiPeripheriegerätePerlPHPPythonRechtliche FragenRedHat, CentOS, FedoraRouter & RoutingSambaSAN, NAS, DASSchriftartenSchulung & TrainingSEOServerServer-HardwareSicherheitSicherheits-ToolsSicherheitsgrundlagenSolarisSonstige SystemeSoziale NetzwerkeSpeicherkartenStudentenjobs & PraktikumSuche ProjektpartnerSuseSwitche und HubsTipps & TricksTK-Netze & GeräteUbuntuUMTS, EDGE & GPRSUtilitiesVB for ApplicationsVerschlüsselung & ZertifikateVideo & StreamingViren und TrojanerVirtualisierungVisual StudioVmwareVoice over IPWebbrowserWebentwicklungWeiterbildungWindows 7Windows 8Windows 10Windows InstallationWindows MobileWindows NetzwerkWindows ServerWindows SystemdateienWindows ToolsWindows UpdateWindows UserverwaltungWindows VistaWindows XPXenserverXMLZusammenarbeit

Brauche für Membership Provider eure Tipps

Frage Entwicklung Datenbanken

Mitglied: MeiSeed

MeiSeed (Level 1) - Jetzt verbinden

23.07.2007 um 10:04 Uhr, 3119 Aufrufe

Hi @ all,


ich breuchte mal eure hilfe bei Access Membership Provider erstellung, ich hab alles so weit fertig nur wenn ich mich einlagen will bekomme ich bei strConn ein fehler ( Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.) kann mir einer sagen was da falsch ist.

Die DB liegt auf einem MSSQL Server 2005 ( server heist VIRTUAL | db SEB_TEST )

Programiere mit VisaulBasic

Hier mal der code von dem webconfig

[code]
<membership defaultProvider="AccessMembershipProvider">
<providers>
<add name="AccessMembershipProvider"
type="AccessMembershipProvider"
requiresQuestionAndAnswer="false"
connectionString="VIRTUAL.SEB_TEST" />
</providers>
</membership>
[/code]

und von Access Membership Provider

[code]
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient

Public Class AccessMembershipProvider
Inherits MembershipProvider

Private strConn As String
Private oCmd As New SqlCommand

Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)
strConn = System.Configuration.ConfigurationManager.ConnectionStrings("VIRTUAL.SEB_TEST").ConnectionString
MyBase.Initialize(name, config)
End Sub

Public Overrides Property ApplicationName() As String
Get
End Get
Set(ByVal value As String)
End Set
End Property

Public Overrides Function ChangePassword(ByVal username As String, ByVal oldPassword As String, ByVal newPassword As String) As Boolean

End Function

Public Overrides Function ChangePasswordQuestionAndAnswer(ByVal username As String, ByVal password As String, ByVal newPasswordQuestion As String, ByVal newPasswordAnswer As String) As Boolean

End Function

Public Overrides Function CreateUser(ByVal username As String, ByVal password As String, ByVal email As String, ByVal passwordQuestion As String, ByVal passwordAnswer As String, ByVal isApproved As Boolean, ByVal providerUserKey As Object, ByRef status As System.Web.Security.MembershipCreateStatus) As System.Web.Security.MembershipUser
Dim oConn As New SqlConnection(strConn)
Try
oConn.Open()
Dim strSql As String = "INSERT INTO tblLogin VALUES (" & _
"@username, @password, @email )"
Dim oCmd As New SqlCommand(strSql, oConn)
oCmd.Parameters.AddWithValue("@username", username)
oCmd.Parameters.AddWithValue("@password", password)
oCmd.Parameters.AddWithValue("@email", email)
Dim i As Integer = oCmd.ExecuteNonQuery()
oConn.Close()
status = MembershipCreateStatus.Success
Dim user As New MembershipUser("AccessMembershipProvider", username, Nothing, email, Nothing, Nothing, True, False, Now, Nothing, Nothing, Nothing, Nothing)
Return user
Catch ex As Exception
status = MembershipCreateStatus.UserRejected
Return Nothing
End Try
End Function

Public Overrides Function DeleteUser(ByVal username As String, ByVal deleteAllRelatedData As Boolean) As Boolean

End Function

Public Overrides ReadOnly Property EnablePasswordReset() As Boolean
Get

End Get
End Property

Public Overrides ReadOnly Property EnablePasswordRetrieval() As Boolean
Get

End Get
End Property

Public Overrides Function FindUsersByEmail(ByVal emailToMatch As String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef totalRecords As Integer) As System.Web.Security.MembershipUserCollection

End Function

Public Overrides Function FindUsersByName(ByVal usernameToMatch As String, ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef totalRecords As Integer) As System.Web.Security.MembershipUserCollection

End Function

Public Overrides Function GetAllUsers(ByVal pageIndex As Integer, ByVal pageSize As Integer, ByRef totalRecords As Integer) As System.Web.Security.MembershipUserCollection

End Function

Public Overrides Function GetNumberOfUsersOnline() As Integer

End Function

Public Overrides Function GetPassword(ByVal username As String, ByVal answer As String) As String

End Function

Public Overloads Overrides Function GetUser(ByVal providerUserKey As Object, ByVal userIsOnline As Boolean) As System.Web.Security.MembershipUser

End Function

Public Overloads Overrides Function GetUser(ByVal username As String, ByVal userIsOnline As Boolean) As System.Web.Security.MembershipUser

End Function

Public Overrides Function GetUserNameByEmail(ByVal email As String) As String

End Function

Public Overrides ReadOnly Property MaxInvalidPasswordAttempts() As Integer
Get

End Get
End Property

Public Overrides ReadOnly Property MinRequiredNonAlphanumericCharacters() As Integer
Get

End Get
End Property

Public Overrides ReadOnly Property MinRequiredPasswordLength() As Integer
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordAttemptWindow() As Integer
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordFormat() As System.Web.Security.MembershipPasswordFormat
Get

End Get
End Property

Public Overrides ReadOnly Property PasswordStrengthRegularExpression() As String
Get

End Get
End Property

Public Overrides ReadOnly Property RequiresQuestionAndAnswer() As Boolean
Get
Return False
End Get
End Property

Public Overrides ReadOnly Property RequiresUniqueEmail() As Boolean
Get

End Get
End Property

Public Overrides Function ResetPassword(ByVal username As String, ByVal answer As String) As String

End Function

Public Overrides Function UnlockUser(ByVal userName As String) As Boolean

End Function

Public Overrides Sub UpdateUser(ByVal user As System.Web.Security.MembershipUser)

End Sub

Public Overrides Function ValidateUser(ByVal username As String, ByVal password As String) As Boolean
Dim oCon As New SqlConnection(strConn)
Try
oCon.Open()
Dim strSql As String = "SELECT * FROM tblLogin WHERE " & _
"username=@username AND password=@password"
Dim oCmd As New SqlCommand(strSql, oCon)
oCmd.Parameters.AddWithValue("@username", username)
oCmd.Parameters.AddWithValue("@password", password)
Dim oReader As SqlDataReader = oCmd.ExecuteReader
If oReader.HasRows Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try
End Function
End Class

[/code]

danke schon mal im voraus für eure hilfe

Gruß
Meiseed
Neuester Wissensbeitrag
Microsoft Office

MS Office Excel - Formel wird angezeigt, aber nicht berechneter Wert!

Tipp von holli.zimmi zum Thema Microsoft Office ...

Ähnliche Inhalte
Cluster
Brauche hilfe beim einrichten von Galera Cluster for MySQL

Frage von akadawa zum Thema Cluster ...

Router & Routing
Tipps für Router (ca. 100 clients, VPN) (21)

Frage von oel-auge zum Thema Router & Routing ...

Entwicklung
Was brauche ich um über PHP eine Oberfläche zu erstellen? (10)

Frage von SIMONJAKOB zum Thema Entwicklung ...

Batch & Shell
Brauche Hilfe mit einem Batch Script( or condition) (21)

Frage von fireskyer zum Thema Batch & Shell ...

Heiß diskutierte Inhalte
Hyper-V
gelöst Reiner Hyper- V Server oder lieber Rolle (21)

Frage von Winuser zum Thema Hyper-V ...

SAN, NAS, DAS
gelöst Synology Version 6.1 Probleme (18)

Frage von Hendrik2586 zum Thema SAN, NAS, DAS ...

Router & Routing
gelöst Firtzbox VPN nicht alle Ports erreichbar? (15)

Frage von atarjono zum Thema Router & Routing ...

Router & Routing
gelöst IP Kamera für drei unabhängige Netzwerke (15)

Frage von ProfessorZ zum Thema Router & Routing ...