-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
SqlProfileProvider.xml
809 lines (676 loc) · 69.1 KB
/
SqlProfileProvider.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
<Type Name="SqlProfileProvider" FullName="System.Web.Profile.SqlProfileProvider">
<TypeSignature Language="C#" Value="public class SqlProfileProvider : System.Web.Profile.ProfileProvider" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit SqlProfileProvider extends System.Web.Profile.ProfileProvider" />
<TypeSignature Language="DocId" Value="T:System.Web.Profile.SqlProfileProvider" />
<TypeSignature Language="VB.NET" Value="Public Class SqlProfileProvider
Inherits ProfileProvider" />
<TypeSignature Language="F#" Value="type SqlProfileProvider = class
 inherit ProfileProvider" />
<TypeSignature Language="C++ CLI" Value="public ref class SqlProfileProvider : System::Web::Profile::ProfileProvider" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.Profile.ProfileProvider</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Manages storage of profile information for an ASP.NET application in a SQL Server database.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The ASP.NET profile is used to store and retrieve user settings in a data source such as a database. The user profile is accessed using the <xref:System.Web.HttpContext.Profile%2A> property of the current <xref:System.Web.HttpContext>. Profile information and property values are managed using a profile provider.
The <xref:System.Web.Profile.SqlProfileProvider> class is used by ASP.NET to store and retrieve profile settings for an ASP.NET application that is using a SQL Server database. To use a <xref:System.Web.Profile.SqlProfileProvider>, you must first create the SQL Server database used by the <xref:System.Web.Profile.SqlProfileProvider>. To create the database used by the <xref:System.Web.Profile.SqlProfileProvider>, run the aspnet_regsql.exe tool, which is found in the [*drive*:]\WINDOWS\Microsoft.NET\Framework\\`2.0versionNumber` folder, and specify the **-A p** option. The following command demonstrates how you might use the aspnet_regsql.exe executable:
```
aspnet_regsql.exe -A p
```
The example above does not specify a name for the database that is created, so the default name will be used. The default database name is Aspnetdb.
The machine configuration contains a default <xref:System.Web.Profile.SqlProfileProvider> instance named AspNetSqlProvider that connects to the SQL Server on the local machine. You can use this instance of the provider, or specify your own in the Web.config file for your ASP.NET application.
> [!NOTE]
> If the profile provider is configured with a connection string that uses integrated security, the process account of the ASP.NET application must have rights to connect to the SQL Server database.
## Examples
The following code example shows the Web.config file for an ASP.NET application configured to use a <xref:System.Web.Profile.SqlProfileProvider>.
```
<configuration>
<connectionStrings>
<add name="SqlServices" connectionString=
"Data Source=localhost;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<authentication mode="Forms" >
<forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
<membership defaultProvider="SqlProvider"
userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
enablePasswordRetrieval="true"
enablePasswordReset="true"
passwordFormat="Encrypted"
requiresQuestionAndAnswer="true" />
</providers>
</membership>
<profile defaultProvider="SqlProvider">
<providers>
<clear />
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="SampleApplication"
description="SqlProfileProvider for SampleApplication" />
</providers>
<properties>
<add name="ZipCode" />
<add name="CityAndState" />
</properties>
</profile>
</system.web>
</configuration>
```
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SqlProfileProvider ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 SqlProfileProvider();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Creates an instance of the <see cref="T:System.Web.Profile.SqlProfileProvider" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASP.NET calls the <xref:System.Web.Profile.SqlProfileProvider.%23ctor%2A> constructor to create an instance of the <xref:System.Web.Profile.SqlProfileProvider> class using the values specified in the configuration file for the application. This constructor is not intended to be used from your code.
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="ApplicationName">
<MemberSignature Language="C#" Value="public override string ApplicationName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ApplicationName" />
<MemberSignature Language="DocId" Value="P:System.Web.Profile.SqlProfileProvider.ApplicationName" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property ApplicationName As String" />
<MemberSignature Language="F#" Value="member this.ApplicationName : string with get, set" Usage="System.Web.Profile.SqlProfileProvider.ApplicationName" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual property System::String ^ ApplicationName { System::String ^ get(); void set(System::String ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the application for which to store and retrieve profile information.</summary>
<value>The name of the application for which to store and retrieve profile information. The default is the <see cref="P:System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath" /> value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property is used by the <xref:System.Web.Profile.SqlProfileProvider> to associate profile information with different applications. This enables multiple applications to use the same database to store user information without running into conflicts between duplicate users. Multiple ASP.NET applications can use the same user database by specifying the same value in the <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property. The <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property can be set programmatically, or it can be set declaratively in the configuration file for the Web application using the `applicationName` attribute.
If a value is not specified for the `applicationName` attribute in the configuration file for the Web application, then the <xref:System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath%2A> value is used for ASP.NET applications. For non-ASP.NET applications, the default value is the <xref:System.Diagnostics.ProcessModule.ModuleName%2A> value without the file extension.
> [!CAUTION]
> Because a single default profile provider instance is used for all of the requests served by an <xref:System.Web.HttpApplication> object, you can have multiple requests executing concurrently and attempting to set the <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property value. The <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property is not thread safe for multiple writes, and changing the <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property value can result in unexpected behavior for multiple users of an application. It is recommended that you avoid writing code that allows users to set the <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property unless you must. An example of an application where setting the <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property may be required is an administrative application that manages profile data for multiple applications. Such an application should be a single-user application and not a Web application.
## Examples
The following code example shows the `profile` element in the `system.web` section of the Web.config file for an ASP.NET application. It specifies the application's <xref:System.Web.Profile.SqlProfileProvider> instance and sets the <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A> property value to `MyApplication`.
```
<profile defaultProvider="SqlProvider">
<providers>
<add name="SqlProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices"
applicationName="MyApplication" />
</providers>
</profile>
```
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">An attempt was made to set the <see cref="P:System.Web.Profile.SqlProfileProvider.ApplicationName" /> property by a caller that does not have <see cref="F:System.Web.AspNetHostingPermissionLevel.High" /> ASP.NET hosting permission.</exception>
<exception cref="T:System.Configuration.Provider.ProviderException">An attempt was made to set the <see cref="P:System.Web.Profile.SqlProfileProvider.ApplicationName" /> property to a string that is longer than 256 characters.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="DeleteInactiveProfiles">
<MemberSignature Language="C#" Value="public override int DeleteInactiveProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 DeleteInactiveProfiles(valuetype System.Web.Profile.ProfileAuthenticationOption authenticationOption, valuetype System.DateTime userInactiveSinceDate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.DeleteInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption,System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function DeleteInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime) As Integer" />
<MemberSignature Language="F#" Value="override this.DeleteInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime -> int" Usage="sqlProfileProvider.DeleteInactiveProfiles (authenticationOption, userInactiveSinceDate)" />
<MemberSignature Language="C++ CLI" Value="public:
 override int DeleteInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="authenticationOption" Type="System.Web.Profile.ProfileAuthenticationOption" />
<Parameter Name="userInactiveSinceDate" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="authenticationOption">One of the <see cref="T:System.Web.Profile.ProfileAuthenticationOption" /> values, specifying whether anonymous, authenticated, or both types of profiles are deleted.</param>
<param name="userInactiveSinceDate">A <see cref="T:System.DateTime" /> that identifies which user profiles are considered inactive. If the <see cref="P:System.Web.Profile.ProfileInfo.LastActivityDate" /> of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
<summary>Deletes user profile data for profiles in which the last activity date occurred before the specified date and time.</summary>
<returns>The number of profiles deleted from the data source.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.DeleteInactiveProfiles%2A> method is used to remove unused profile data from the data source for the application specified by the `applicationName` attribute in the configuration file. Use the `authenticationOption` parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched. Of the searched profiles, any profile with a <xref:System.Web.Profile.ProfileInfo.LastActivityDate%2A> that occurs on or before the specified `userInactiveSinceDate` parameter value is deleted.
The database updates that are performed during the call to the <xref:System.Web.Profile.SqlProfileProvider.DeleteInactiveProfiles%2A> method are made within a transaction. If an error is encountered, the transaction is rolled back and no updates are performed.
## Examples
The following code example shows an ASP.NET page that manages inactive profiles. A button is provided to delete all profiles that have not been accessed since the date specified for considering a profile to be inactive.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#4](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/DeleteInactiveProfilescs.aspx#4)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#4](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/DeleteInactiveProfilesvb.aspx#4)]
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<MemberGroup MemberName="DeleteProfiles">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Deletes profile properties and information from the data source.</summary>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</MemberGroup>
<Member MemberName="DeleteProfiles">
<MemberSignature Language="C#" Value="public override int DeleteProfiles (string[] usernames);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 DeleteProfiles(string[] usernames) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.DeleteProfiles(System.String[])" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function DeleteProfiles (usernames As String()) As Integer" />
<MemberSignature Language="F#" Value="override this.DeleteProfiles : string[] -> int" Usage="sqlProfileProvider.DeleteProfiles usernames" />
<MemberSignature Language="C++ CLI" Value="public:
 override int DeleteProfiles(cli::array <System::String ^> ^ usernames);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="usernames" Type="System.String[]" />
</Parameters>
<Docs>
<param name="usernames">A string array of user names for profiles to be deleted.</param>
<summary>Deletes profile properties and information from the data source for the supplied list of user names.</summary>
<returns>The number of profiles deleted from the data source.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.DeleteProfiles%2A> method deletes all profile information and properties for the specified profiles from the data source for the application specified by the `applicationName` attribute in the configuration file. The list of profiles to delete is specified as a string array of user names. If profile properties and information exist in the data source for a user name in the `usernames` parameter, they are deleted.
The return value may differ from the length of the specified array of `usernames`. This indicates that some of the profiles in the specified array of `usernames` were already deleted from the data store.
The database updates that are performed during the call to the <xref:System.Web.Profile.SqlProfileProvider.DeleteProfiles%2A> method are made within a transaction. If an error is encountered, the transaction is rolled back and no updates are performed.
## Examples
The following code example shows an ASP.NET page that manages inactive profiles. A <xref:System.Web.UI.WebControls.GridView> control displays the inactive profiles returned. Each row of the <xref:System.Web.UI.WebControls.GridView> control includes a button that deletes the profile for that row from the data source with a call to the <xref:System.Web.Profile.SqlProfileProvider.DeleteProfiles%2A> method.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#4](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/DeleteInactiveProfilescs.aspx#4)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#4](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/DeleteInactiveProfilesvb.aspx#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The length of <paramref name="usernames" /> is zero.
-or-
One of the items in <paramref name="usernames" /> is an empty string (""), exceeds a length of 256 characters, or contains a comma.
-or-
Two or more items in <paramref name="usernames" /> have the same value.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="usernames" /> is <see langword="null" />.
-or-
One of the items in <paramref name="usernames" /> is <see langword="null" />.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="DeleteProfiles">
<MemberSignature Language="C#" Value="public override int DeleteProfiles (System.Web.Profile.ProfileInfoCollection profiles);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 DeleteProfiles(class System.Web.Profile.ProfileInfoCollection profiles) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.DeleteProfiles(System.Web.Profile.ProfileInfoCollection)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function DeleteProfiles (profiles As ProfileInfoCollection) As Integer" />
<MemberSignature Language="F#" Value="override this.DeleteProfiles : System.Web.Profile.ProfileInfoCollection -> int" Usage="sqlProfileProvider.DeleteProfiles profiles" />
<MemberSignature Language="C++ CLI" Value="public:
 override int DeleteProfiles(System::Web::Profile::ProfileInfoCollection ^ profiles);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="profiles" Type="System.Web.Profile.ProfileInfoCollection" />
</Parameters>
<Docs>
<param name="profiles">A <see cref="T:System.Web.Profile.ProfileInfoCollection" /> that contains profile information for profiles to be deleted.</param>
<summary>Deletes profile properties and information for the supplied list of profiles from the data source.</summary>
<returns>The number of profiles deleted from the data source.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.DeleteProfiles%2A> method deletes all profile information and properties for the specified profiles from the data source for the application specified by the `applicationName` attribute in the configuration file. The list of profiles to delete is specified using a <xref:System.Web.Profile.ProfileInfoCollection> that is passed as the `profiles` parameter. A <xref:System.Web.Profile.ProfileInfoCollection> can be returned from the <xref:System.Web.Profile.SqlProfileProvider.GetAllProfiles%2A>, <xref:System.Web.Profile.SqlProfileProvider.GetAllInactiveProfiles%2A>, <xref:System.Web.Profile.SqlProfileProvider.FindProfilesByUserName%2A>, and <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> methods.
The return value may differ from the <xref:System.Web.Profile.ProfileInfoCollection.Count%2A> value for the supplied <xref:System.Web.Profile.ProfileInfoCollection>. This indicates that some of the profiles in the specified <xref:System.Web.Profile.ProfileInfoCollection> were no longer found in the data store.
The database updates that are performed during the call to the <xref:System.Web.Profile.SqlProfileProvider.DeleteProfiles%2A> method are made within a transaction. If an error is encountered, the transaction is rolled back and no updates are performed.
## Examples
The following code example allows a user to search for profiles using the <xref:System.Web.Profile.SqlProfileProvider.FindProfilesByUserName%2A> and <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> methods. The user can then delete the returned profiles with a call to the <xref:System.Web.Profile.SqlProfileProvider.DeleteProfiles%2A> method.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#5](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/FindProfilesByUserNamecs.aspx#5)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#5](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/FindProfilesByUserNamevb.aspx#5)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="profiles" /> has a <see cref="P:System.Web.Profile.ProfileInfoCollection.Count" /> value of zero.
-or-
One of the <see cref="T:System.Web.Profile.ProfileInfo" /> objects in <paramref name="profiles" /> has a <see cref="P:System.Web.Profile.ProfileInfo.UserName" /> that is an empty string (""), exceeds a length of 256 characters, or contains a comma.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="profiles" /> is <see langword="null" />.
-or-
One of the <see cref="T:System.Web.Profile.ProfileInfo" /> objects in <paramref name="profiles" /> has a <see cref="P:System.Web.Profile.ProfileInfo.UserName" /> that is <see langword="null" />.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="FindInactiveProfilesByUserName">
<MemberSignature Language="C#" Value="public override System.Web.Profile.ProfileInfoCollection FindInactiveProfilesByUserName (System.Web.Profile.ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Web.Profile.ProfileInfoCollection FindInactiveProfilesByUserName(valuetype System.Web.Profile.ProfileAuthenticationOption authenticationOption, string usernameToMatch, valuetype System.DateTime userInactiveSinceDate, int32 pageIndex, int32 pageSize, [out] int32& totalRecords) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName(System.Web.Profile.ProfileAuthenticationOption,System.String,System.DateTime,System.Int32,System.Int32,System.Int32@)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function FindInactiveProfilesByUserName (authenticationOption As ProfileAuthenticationOption, usernameToMatch As String, userInactiveSinceDate As DateTime, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection" />
<MemberSignature Language="F#" Value="override this.FindInactiveProfilesByUserName : System.Web.Profile.ProfileAuthenticationOption * string * DateTime * int * int * int -> System.Web.Profile.ProfileInfoCollection" Usage="sqlProfileProvider.FindInactiveProfilesByUserName (authenticationOption, usernameToMatch, userInactiveSinceDate, pageIndex, pageSize, totalRecords)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Web::Profile::ProfileInfoCollection ^ FindInactiveProfilesByUserName(System::Web::Profile::ProfileAuthenticationOption authenticationOption, System::String ^ usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.Profile.ProfileInfoCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="authenticationOption" Type="System.Web.Profile.ProfileAuthenticationOption" />
<Parameter Name="usernameToMatch" Type="System.String" />
<Parameter Name="userInactiveSinceDate" Type="System.DateTime" />
<Parameter Name="pageIndex" Type="System.Int32" />
<Parameter Name="pageSize" Type="System.Int32" />
<Parameter Name="totalRecords" Type="System.Int32" RefType="out" />
</Parameters>
<Docs>
<param name="authenticationOption">One of the <see cref="T:System.Web.Profile.ProfileAuthenticationOption" /> values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
<param name="usernameToMatch">The user name for which to search.</param>
<param name="userInactiveSinceDate">A <see cref="T:System.DateTime" /> that identifies which user profiles are considered inactive. If the <see cref="P:System.Web.Profile.ProfileInfo.LastActivityDate" /> of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
<param name="pageIndex">The index of the page of results to return. <paramref name="pageIndex" /> is zero-based.</param>
<param name="pageSize">The size of the page of results to return.</param>
<param name="totalRecords">When this method returns, contains an integer that identifies the total number of profiles. This parameter is passed uninitialized.</param>
<summary>Retrieves profile information for profiles in which the last activity date occurred on or before the specified date and time and the user name for the profile matches the specified name.</summary>
<returns>A <see cref="T:System.Web.Profile.ProfileInfoCollection" /> containing user profile information for inactive profiles where the user name matches the supplied <paramref name="usernameToMatch" /> parameter.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> method is used to retrieve profile information for unused user profiles for the application specified by the `applicationName` attribute in the configuration file. This method will only retrieve profiles for which the user name for the profile matches the supplied `usernameToMatch` parameter value. Use the `authenticationOption` parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched. Of the searched profiles, any profile with a <xref:System.Web.Profile.ProfileInfo.LastActivityDate%2A> that occurs before the specified `userInactiveSinceDate` parameter value is returned.
The <xref:System.Web.Profile.SqlProfileProvider> searches for a match of the `usernameToMatch` parameter value using the `LIKE` keyword and supports wildcard characters, such as the percent (%) sign. For example, if the `usernameToMatch` parameter is set to "user1", then profile information for the profile with the user name of "user1" is returned, if it exists. If the `usernameToMatch` parameter is set to "user%", then profile information for profiles with the user name of "user1", "user2", "user_admin", and so on are returned. Users are returned in the order that their profiles were added to the data store.
The results returned by <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> are constrained by the `pageIndex` and `pageSize` parameters. The `pageSize` parameter identifies the maximum number of <xref:System.Web.Profile.ProfileInfo> objects to return in the <xref:System.Web.Profile.ProfileInfoCollection>. The `pageIndex` parameter identifies which page of results to return; 0 identifies the first page. The `totalRecords` parameter is an `out` parameter that is set to the total number of inactive user profiles for the configured `applicationName`, based on the `authenticationOption` and `userInactiveSinceDate` parameters. For example, if there are 13 users for the configured `applicationName`, and the `pageIndex` value is 1 with a `pageSize` of 5, the <xref:System.Web.Profile.ProfileInfoCollection> returned will contain the sixth through the tenth inactive profiles. The `totalRecords` parameter will be set to 13.
## Examples
The following code example allows a user to supply a `usernameToMatch` value and a <xref:System.Web.Profile.ProfileAuthenticationOption> and retrieves profile information for any matching profiles. The example also allows the user to specify whether to return inactive profiles exclusively. If the user specifies only inactive profiles, the <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> method is called; otherwise, the <xref:System.Web.Profile.SqlProfileProvider.FindProfilesByUserName%2A> method is called.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#5](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/FindProfilesByUserNamecs.aspx#5)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#5](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/FindProfilesByUserNamevb.aspx#5)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="usernameToMatch" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="usernameToMatch" /> is an empty string ("") or exceeds 256 characters.
-or-
<paramref name="pageIndex" /> is less than zero.
-or-
<paramref name="pageSize" /> is less than one.
-or-
<paramref name="pageIndex" /> multiplied by <paramref name="pageSize" /> is larger than <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="FindProfilesByUserName">
<MemberSignature Language="C#" Value="public override System.Web.Profile.ProfileInfoCollection FindProfilesByUserName (System.Web.Profile.ProfileAuthenticationOption authenticationOption, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Web.Profile.ProfileInfoCollection FindProfilesByUserName(valuetype System.Web.Profile.ProfileAuthenticationOption authenticationOption, string usernameToMatch, int32 pageIndex, int32 pageSize, [out] int32& totalRecords) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.FindProfilesByUserName(System.Web.Profile.ProfileAuthenticationOption,System.String,System.Int32,System.Int32,System.Int32@)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function FindProfilesByUserName (authenticationOption As ProfileAuthenticationOption, usernameToMatch As String, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection" />
<MemberSignature Language="F#" Value="override this.FindProfilesByUserName : System.Web.Profile.ProfileAuthenticationOption * string * int * int * int -> System.Web.Profile.ProfileInfoCollection" Usage="sqlProfileProvider.FindProfilesByUserName (authenticationOption, usernameToMatch, pageIndex, pageSize, totalRecords)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Web::Profile::ProfileInfoCollection ^ FindProfilesByUserName(System::Web::Profile::ProfileAuthenticationOption authenticationOption, System::String ^ usernameToMatch, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.Profile.ProfileInfoCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="authenticationOption" Type="System.Web.Profile.ProfileAuthenticationOption" />
<Parameter Name="usernameToMatch" Type="System.String" />
<Parameter Name="pageIndex" Type="System.Int32" />
<Parameter Name="pageSize" Type="System.Int32" />
<Parameter Name="totalRecords" Type="System.Int32" RefType="out" />
</Parameters>
<Docs>
<param name="authenticationOption">One of the <see cref="T:System.Web.Profile.ProfileAuthenticationOption" /> values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
<param name="usernameToMatch">The user name for which to search.</param>
<param name="pageIndex">The index of the page of results to return. <paramref name="pageIndex" /> is zero-based.</param>
<param name="pageSize">The size of the page of results to return.</param>
<param name="totalRecords">When this method returns, contains an integer that identifies the total number of profiles. This parameter is passed uninitialized.</param>
<summary>Retrieves profile information for profiles in which the user name matches the specified name.</summary>
<returns>A <see cref="T:System.Web.Profile.ProfileInfoCollection" /> containing user profile information for profiles where the user name matches the supplied <paramref name="usernameToMatch" /> parameter.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> method returns a list of profile information for which the user name for the profile matches the supplied `usernameToMatch` parameter value for the configured <xref:System.Web.Profile.SqlProfileProvider.ApplicationName%2A>. Use the `authenticationOption` parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched.
The <xref:System.Web.Profile.SqlProfileProvider> searches for a match of the `usernameToMatch` parameter value using the `LIKE` keyword and supports wildcard characters, such as the percent (%) sign. For example, if the `usernameToMatch` parameter is set to "user1", then profile information for the profile with the user name of "user1" is returned, if it exists. If the `usernameToMatch` parameter is set to "user%", then profile information for profiles with the user name of "user1", "user2", "user_admin", and so on are returned. Users are returned in the order that their profiles were added to the data store.
The results returned by <xref:System.Web.Profile.SqlProfileProvider.FindProfilesByUserName%2A> are constrained by the `pageIndex` and `pageSize` parameters. The `pageSize` parameter identifies the maximum number of <xref:System.Web.Profile.ProfileInfo> objects to return in the <xref:System.Web.Profile.ProfileInfoCollection>. The `pageIndex` parameter identifies which page of results to return; 0 identifies the first page. The `totalRecords` parameter is an `out` parameter that is set to the total number of inactive user profiles for the application specified by the `applicationName` attribute in the configuration file, based on the `authenticationOption` and `userInactiveSinceDate` parameters. For example, if there are 13 users for the configured `applicationName`, and the `pageIndex` value is 1 with a `pageSize` of 5, the <xref:System.Web.Profile.ProfileInfoCollection> returned will contain the sixth through the tenth profiles. The `totalRecords` parameter will be set to 13.
## Examples
The following code example allows a user to supply a `usernameToMatch` value and a <xref:System.Web.Profile.ProfileAuthenticationOption> and retrieves profile information for any matching profiles. The example also allows the user to specify whether to return inactive profiles exclusively. If the user specifies only inactive profiles, the <xref:System.Web.Profile.SqlProfileProvider.FindInactiveProfilesByUserName%2A> method is called; otherwise, the <xref:System.Web.Profile.SqlProfileProvider.FindProfilesByUserName%2A> method is called.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#5](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/FindProfilesByUserNamecs.aspx#5)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#5](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/FindProfilesByUserNamevb.aspx#5)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="usernameToMatch" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="usernameToMatch" /> is an empty string ("") or exceeds 256 characters.
-or-
<paramref name="pageIndex" /> is less than zero.
-or-
<paramref name="pageSize" /> is less than one.
-or-
<paramref name="pageIndex" /> multiplied by <paramref name="pageSize" /> is larger than <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="GetAllInactiveProfiles">
<MemberSignature Language="C#" Value="public override System.Web.Profile.ProfileInfoCollection GetAllInactiveProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Web.Profile.ProfileInfoCollection GetAllInactiveProfiles(valuetype System.Web.Profile.ProfileAuthenticationOption authenticationOption, valuetype System.DateTime userInactiveSinceDate, int32 pageIndex, int32 pageSize, [out] int32& totalRecords) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.GetAllInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption,System.DateTime,System.Int32,System.Int32,System.Int32@)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetAllInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection" />
<MemberSignature Language="F#" Value="override this.GetAllInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime * int * int * int -> System.Web.Profile.ProfileInfoCollection" Usage="sqlProfileProvider.GetAllInactiveProfiles (authenticationOption, userInactiveSinceDate, pageIndex, pageSize, totalRecords)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Web::Profile::ProfileInfoCollection ^ GetAllInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.Profile.ProfileInfoCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="authenticationOption" Type="System.Web.Profile.ProfileAuthenticationOption" />
<Parameter Name="userInactiveSinceDate" Type="System.DateTime" />
<Parameter Name="pageIndex" Type="System.Int32" />
<Parameter Name="pageSize" Type="System.Int32" />
<Parameter Name="totalRecords" Type="System.Int32" RefType="out" />
</Parameters>
<Docs>
<param name="authenticationOption">One of the <see cref="T:System.Web.Profile.ProfileAuthenticationOption" /> values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
<param name="userInactiveSinceDate">A <see cref="T:System.DateTime" /> that identifies which user profiles are considered inactive. If the <see cref="P:System.Web.Profile.ProfileInfo.LastActivityDate" /> of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
<param name="pageIndex">The index of the page of results to return. <paramref name="pageIndex" /> is zero-based.</param>
<param name="pageSize">The size of the page of results to return.</param>
<param name="totalRecords">When this method returns, contains an integer that identifies the total number of profiles. This parameter is passed uninitialized.</param>
<summary>Retrieves user profile data for profiles in which the last activity date occurred on or before the specified date and time.</summary>
<returns>A <see cref="T:System.Web.Profile.ProfileInfoCollection" /> containing user profile information about the inactive profiles.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.GetAllInactiveProfiles%2A> method is used to retrieve profile information from the data source for unused user profiles for the application specified by the `applicationName` attribute in the configuration file. Use the `authenticationOption` parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched. Of the searched profiles, any profile with a <xref:System.Web.Profile.ProfileInfo.LastActivityDate%2A> that occurs before the specified `userInactiveSinceDate` parameter value is returned.
The results returned by <xref:System.Web.Profile.SqlProfileProvider.GetAllInactiveProfiles%2A> are constrained by the `pageIndex` and `pageSize` parameters. The `pageSize` parameter identifies the maximum number of <xref:System.Web.Profile.ProfileInfo> objects to return in the <xref:System.Web.Profile.ProfileInfoCollection>. The `pageIndex` parameter identifies which page of results to return; 0 identifies the first page. The `totalRecords` parameter is an `out` parameter that is set to the total number of inactive user profiles for the configured `applicationName`, based on the `authenticationOption` and `userInactiveSinceDate` parameters. For example, if there are 13 users for the configured `applicationName`, and the `pageIndex` value is 1 with a `pageSize` of 5, the <xref:System.Web.Profile.ProfileInfoCollection> returned will contain the sixth through the tenth inactive profiles. The `totalRecords` parameter will be set to 13.
## Examples
The following code example shows an ASP.NET page that manages inactive profiles. A button is provided to delete all inactive profiles. Whether a profile is considered inactive is based on the date specified for the `userInactiveSinceDate` parameter.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#4](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/DeleteInactiveProfilescs.aspx#4)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#4](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/DeleteInactiveProfilesvb.aspx#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="pageIndex" /> is less than zero.
-or-
<paramref name="pageSize" /> is less than one.
-or-
<paramref name="pageIndex" /> multiplied by <paramref name="pageSize" /> is larger than <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="GetAllProfiles">
<MemberSignature Language="C#" Value="public override System.Web.Profile.ProfileInfoCollection GetAllProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Web.Profile.ProfileInfoCollection GetAllProfiles(valuetype System.Web.Profile.ProfileAuthenticationOption authenticationOption, int32 pageIndex, int32 pageSize, [out] int32& totalRecords) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.GetAllProfiles(System.Web.Profile.ProfileAuthenticationOption,System.Int32,System.Int32,System.Int32@)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetAllProfiles (authenticationOption As ProfileAuthenticationOption, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection" />
<MemberSignature Language="F#" Value="override this.GetAllProfiles : System.Web.Profile.ProfileAuthenticationOption * int * int * int -> System.Web.Profile.ProfileInfoCollection" Usage="sqlProfileProvider.GetAllProfiles (authenticationOption, pageIndex, pageSize, totalRecords)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Web::Profile::ProfileInfoCollection ^ GetAllProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.Profile.ProfileInfoCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="authenticationOption" Type="System.Web.Profile.ProfileAuthenticationOption" />
<Parameter Name="pageIndex" Type="System.Int32" />
<Parameter Name="pageSize" Type="System.Int32" />
<Parameter Name="totalRecords" Type="System.Int32" RefType="out" />
</Parameters>
<Docs>
<param name="authenticationOption">One of the <see cref="T:System.Web.Profile.ProfileAuthenticationOption" /> values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
<param name="pageIndex">The index of the page of results to return. <paramref name="pageIndex" /> is zero-based.</param>
<param name="pageSize">The size of the page of results to return.</param>
<param name="totalRecords">When this method returns, contains an integer that identifies the total number of profiles. This parameter is passed uninitialized.</param>
<summary>Retrieves user profile data for profiles in the data source.</summary>
<returns>A <see cref="T:System.Web.Profile.ProfileInfoCollection" /> containing user profile information for all of the profiles in the data source.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.GetAllProfiles%2A> method is used to retrieve profile information for profiles from the data source for the application specified by the `applicationName` attribute in the configuration file. Use the `authenticationOption` parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched.
The results returned by <xref:System.Web.Profile.SqlProfileProvider.GetAllInactiveProfiles%2A> are constrained by the `pageIndex` and `pageSize` parameters. The `pageSize` parameter identifies the maximum number of <xref:System.Web.Profile.ProfileInfo> objects to return in the <xref:System.Web.Profile.ProfileInfoCollection>. The `pageIndex` parameter identifies which page of results to return; 0 identifies the first page. The `totalRecords` parameter is an `out` parameter that is set to the total number of inactive user profiles for the configured `applicationName`, based on the `authenticationOption` and `userInactiveSinceDate` parameters. For example, if there are 13 users for the configured `applicationName`, and the `pageIndex` value is 1 with a `pageSize` of 5, the <xref:System.Web.Profile.ProfileInfoCollection> returned will contain the sixth through the tenth profiles. The `totalRecords` parameter will be set to 13.
## Examples
The following code example displays profile information for all of the profiles for the configured `applicationName` in pages of data.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#3](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/ShowProfilescs.aspx#3)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#3](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/ShowProfilesvb.aspx#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="pageIndex" /> is less than zero.
-or-
<paramref name="pageSize" /> is less than one.
-or-
<paramref name="pageIndex" /> multiplied by <paramref name="pageSize" /> is larger than <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="GetNumberOfInactiveProfiles">
<MemberSignature Language="C#" Value="public override int GetNumberOfInactiveProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetNumberOfInactiveProfiles(valuetype System.Web.Profile.ProfileAuthenticationOption authenticationOption, valuetype System.DateTime userInactiveSinceDate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.GetNumberOfInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption,System.DateTime)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetNumberOfInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime) As Integer" />
<MemberSignature Language="F#" Value="override this.GetNumberOfInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime -> int" Usage="sqlProfileProvider.GetNumberOfInactiveProfiles (authenticationOption, userInactiveSinceDate)" />
<MemberSignature Language="C++ CLI" Value="public:
 override int GetNumberOfInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="authenticationOption" Type="System.Web.Profile.ProfileAuthenticationOption" />
<Parameter Name="userInactiveSinceDate" Type="System.DateTime" />
</Parameters>
<Docs>
<param name="authenticationOption">One of the <see cref="T:System.Web.Profile.ProfileAuthenticationOption" /> values, specifying whether anonymous, authenticated, or both types of profiles are returned.</param>
<param name="userInactiveSinceDate">A <see cref="T:System.DateTime" /> that identifies which user profiles are considered inactive. If the <see cref="P:System.Web.Profile.ProfileInfo.LastActivityDate" /> of a user profile occurs on or before this date and time, the profile is considered inactive.</param>
<summary>Gets the number of profiles in the data source where the last activity date occurred on or before the specified <paramref name="userInactiveSinceDate" />.</summary>
<returns>The number of profiles in the data source for which the last activity date occurred before the specified date and time.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.GetNumberOfInactiveProfiles%2A> method is used to retrieve a count of all of the unused user profiles from the data source for the application specified by the `applicationName` attribute in the configuration file. Use the `authenticationOption` parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched. Of the searched profiles, all profiles with a <xref:System.Web.Profile.ProfileInfo.LastActivityDate%2A> that occurs on or before the specified `userInactiveSinceDate` parameter value are counted.
## Examples
The following code example allows a user to view and delete active and inactive profiles information based on search criteria. A count of inactive profiles is displayed using the results of the <xref:System.Web.Profile.SqlProfileProvider.GetNumberOfInactiveProfiles%2A> method.
[!code-aspx-csharp[System.Web.Profile.SqlProfileProvider#5](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/FindProfilesByUserNamecs.aspx#5)]
[!code-aspx-vb[System.Web.Profile.SqlProfileProvider#5](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/FindProfilesByUserNamevb.aspx#5)]
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="GetPropertyValues">
<MemberSignature Language="C#" Value="public override System.Configuration.SettingsPropertyValueCollection GetPropertyValues (System.Configuration.SettingsContext sc, System.Configuration.SettingsPropertyCollection properties);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Configuration.SettingsPropertyValueCollection GetPropertyValues(class System.Configuration.SettingsContext sc, class System.Configuration.SettingsPropertyCollection properties) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.GetPropertyValues(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyCollection)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetPropertyValues (sc As SettingsContext, properties As SettingsPropertyCollection) As SettingsPropertyValueCollection" />
<MemberSignature Language="F#" Value="override this.GetPropertyValues : System.Configuration.SettingsContext * System.Configuration.SettingsPropertyCollection -> System.Configuration.SettingsPropertyValueCollection" Usage="sqlProfileProvider.GetPropertyValues (sc, properties)" />
<MemberSignature Language="C++ CLI" Value="public:
 override System::Configuration::SettingsPropertyValueCollection ^ GetPropertyValues(System::Configuration::SettingsContext ^ sc, System::Configuration::SettingsPropertyCollection ^ properties);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Configuration.SettingsPropertyValueCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="sc" Type="System.Configuration.SettingsContext" />
<Parameter Name="properties" Type="System.Configuration.SettingsPropertyCollection" />
</Parameters>
<Docs>
<param name="sc">The <see cref="T:System.Configuration.SettingsContext" /> that contains user profile information.</param>
<param name="properties">A <see cref="T:System.Configuration.SettingsPropertyCollection" /> containing profile information for the properties to be retrieved.</param>
<summary>Retrieves profile property information and values from a SQL Server profile database.</summary>
<returns>A <see cref="T:System.Configuration.SettingsPropertyValueCollection" /> containing profile property information and values.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.GetPropertyValues%2A> method is used by the <xref:System.Web.Profile.ProfileBase> class to retrieve profile properties for the current request that are managed by the <xref:System.Web.Profile.SqlProfileProvider>. Property values are returned from the data source for the application specified by the `applicationName` attribute in the configuration file. Property values and additional property information are returned as a collection of <xref:System.Configuration.SettingsPropertyValue> objects.
## Examples
The following code example lists the profile properties and values identified in the current profile.
[!code-csharp[System.Web.Profile.SqlProfileProvider#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/getpropertyvaluescs.aspx#1)]
[!code-vb[System.Web.Profile.SqlProfileProvider#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/getpropertyvaluesvb.aspx#1)]
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="Initialize">
<MemberSignature Language="C#" Value="public override void Initialize (string name, System.Collections.Specialized.NameValueCollection config);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Initialize(string name, class System.Collections.Specialized.NameValueCollection config) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.Initialize(System.String,System.Collections.Specialized.NameValueCollection)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub Initialize (name As String, config As NameValueCollection)" />
<MemberSignature Language="F#" Value="override this.Initialize : string * System.Collections.Specialized.NameValueCollection -> unit" Usage="sqlProfileProvider.Initialize (name, config)" />
<MemberSignature Language="C++ CLI" Value="public:
 override void Initialize(System::String ^ name, System::Collections::Specialized::NameValueCollection ^ config);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
<Parameter Name="config" Type="System.Collections.Specialized.NameValueCollection" />
</Parameters>
<Docs>
<param name="name">The name of the <see cref="T:System.Web.Profile.SqlProfileProvider" /> instance to initialize.</param>
<param name="config">A <see cref="T:System.Collections.Specialized.NameValueCollection" /> that contains the names and values of configuration options for the profile provider.</param>
<summary>Initializes the SQL Server profile provider with the property values specified in the ASP.NET application's configuration file. This method is not intended to be used directly from your code.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASP.NET uses this method to initialize the <xref:System.Web.Profile.SqlProfileProvider> with the property values specified in the ASP.NET application configuration file (Web.config). This method is not intended to be used directly from your code.
]]></format>
</remarks>
<exception cref="T:System.Configuration.Provider.ProviderException">The <see langword="connectionStringName" /> attribute is an empty string ("") or is not specified in the application configuration file for this <see cref="T:System.Web.Profile.SqlProfileProvider" /> instance.
-or-
The value of the connection string specified in the <see langword="connectionStringName" /> attribute value is empty or the specified <see langword="connectionStringName" /> value does not exist in the application configuration file for this <see cref="T:System.Web.Profile.SqlProfileProvider" /> instance.
-or-
The <see langword="applicationName" /> attribute value exceeds 256 characters.
-or-
The application configuration file for this <see cref="T:System.Web.Profile.SqlProfileProvider" /> instance contains an unrecognized attribute.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="config" /> is <see langword="null" />.</exception>
<exception cref="T:System.Web.HttpException">The current trust level is less than <see cref="F:System.Web.AspNetHostingPermissionLevel.Low" />.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
<Member MemberName="SetPropertyValues">
<MemberSignature Language="C#" Value="public override void SetPropertyValues (System.Configuration.SettingsContext sc, System.Configuration.SettingsPropertyValueCollection properties);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void SetPropertyValues(class System.Configuration.SettingsContext sc, class System.Configuration.SettingsPropertyValueCollection properties) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Profile.SqlProfileProvider.SetPropertyValues(System.Configuration.SettingsContext,System.Configuration.SettingsPropertyValueCollection)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub SetPropertyValues (sc As SettingsContext, properties As SettingsPropertyValueCollection)" />
<MemberSignature Language="F#" Value="override this.SetPropertyValues : System.Configuration.SettingsContext * System.Configuration.SettingsPropertyValueCollection -> unit" Usage="sqlProfileProvider.SetPropertyValues (sc, properties)" />
<MemberSignature Language="C++ CLI" Value="public:
 override void SetPropertyValues(System::Configuration::SettingsContext ^ sc, System::Configuration::SettingsPropertyValueCollection ^ properties);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="sc" Type="System.Configuration.SettingsContext" />
<Parameter Name="properties" Type="System.Configuration.SettingsPropertyValueCollection" />
</Parameters>
<Docs>
<param name="sc">The <see cref="T:System.Configuration.SettingsContext" /> that contains user profile information.</param>
<param name="properties">A <see cref="T:System.Configuration.SettingsPropertyValueCollection" /> containing profile information and values for the properties to be updated.</param>
<summary>Updates the SQL Server profile database with the specified property values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Profile.SqlProfileProvider.SetPropertyValues%2A> method is used by ASP.NET profile services to update the SQL Server profile database when property values are set for the current request. Property values are set at the data source for the application specified by the `applicationName` attribute in the configuration file. Profile property information and values to be updated by the <xref:System.Web.Profile.SqlProfileProvider> are specified as a collection of <xref:System.Configuration.SettingsPropertyValue> objects.
## Examples
The following code example uses the <xref:System.Web.Profile.SqlProfileProvider.SetPropertyValues%2A> method to modify profile property values.
[!code-csharp[System.Web.Profile.SqlProfileProvider#2](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/CS/setpropertyvaluescs.aspx#2)]
[!code-vb[System.Web.Profile.SqlProfileProvider#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Profile.SqlProfileProvider/VB/setpropertyvaluesvb.aspx#2)]
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/2y3fs9xs(v=vs.100)">ASP.NET Profile Properties Overview</related>
</Docs>
</Member>
</Members>
</Type>