System.Data.SQLite

Check-in [98511b3009]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed a rather annoying bug in Role.DeleteUsersFromRoles. Updated ProviderUtility to give more descriptive errors.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 98511b300995f28b36fbc7a95ea60fde8d2a7d28
User & Date: jeffreyabecker 2006-03-10 19:11:11.000
Context
2006-03-20
17:55
Fix relative paths in Compact Framework check-in: cc914390be user: rmsimpson tags: sourceforge
2006-03-10
19:11
Fixed a rather annoying bug in Role.DeleteUsersFromRoles. Updated ProviderUtility to give more descriptive errors. check-in: 98511b3009 user: jeffreyabecker tags: sourceforge
2006-03-09
15:21
Code and comments cleanup check-in: a428d558a9 user: rmsimpson tags: sourceforge
Changes
Unified Diff Ignore Whitespace Patch
Changes to Membership/SQLiteProvider.suo.

cannot compute difference between binary files

Changes to Membership/Sql/RoleSql.Designer.cs.
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Delete From UserRoleMap
        ///Where
        ///UserID = (Select UserID from User where Username = $Username and AppID = $AppID)
        ///AND
        ///RoleID = (Select RoleID from Role Rolename = $Rolename AND AppID = $AppID);
        ///.
        /// </summary>
        internal static string DeleteUserFromRole {
            get {
                return ResourceManager.GetString("DeleteUserFromRole", resourceCulture);
            }
        }







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
        }
        
        /// <summary>
        ///   Looks up a localized string similar to Delete From UserRoleMap
        ///Where
        ///UserID = (Select UserID from User where Username = $Username and AppID = $AppID)
        ///AND
        ///RoleID = (Select RoleID from Role Where Rolename = $Rolename AND AppID = $AppID);
        ///.
        /// </summary>
        internal static string DeleteUserFromRole {
            get {
                return ResourceManager.GetString("DeleteUserFromRole", resourceCulture);
            }
        }
Changes to Membership/Sql/RoleSql.resx.
1
2



























































3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8"?>
<root>



























































  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 
    
    Version 2.0
    
    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.
    
    Example:
    
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
                
    There are any number of "resheader" rows that contain simple 
    name/value pairs.
    
    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.
    
    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:
    
    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.
    
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
    <value>DELETE FROM UserRoleMap WHERE RoleID = (Select RoleID from Role where Rolename = $Rolename  AND AppID = $AppID) AND AppID = $AppID</value>
  </data>
  <data name="DeleteUserFromRole" xml:space="preserve">
    <value>Delete From UserRoleMap
Where
UserID = (Select UserID from User where Username = $Username and AppID = $AppID)
AND
RoleID = (Select RoleID from Role Rolename = $Rolename AND AppID = $AppID);
</value>
  </data>
  <data name="FindUsersInRole" xml:space="preserve">
    <value>Select User.Username from User
Inner Join UserRoleMap on User.UserID = UserRoleMap.UserID
Inner Join Role on UserRoleMap.RoleID = Role.RoleID
Where Role.Rolename = $RoleName and Role.AppID = $AppID and User.Username Like $Username;</value>







|







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
    <value>DELETE FROM UserRoleMap WHERE RoleID = (Select RoleID from Role where Rolename = $Rolename  AND AppID = $AppID) AND AppID = $AppID</value>
  </data>
  <data name="DeleteUserFromRole" xml:space="preserve">
    <value>Delete From UserRoleMap
Where
UserID = (Select UserID from User where Username = $Username and AppID = $AppID)
AND
RoleID = (Select RoleID from Role Where Rolename = $Rolename AND AppID = $AppID);
</value>
  </data>
  <data name="FindUsersInRole" xml:space="preserve">
    <value>Select User.Username from User
Inner Join UserRoleMap on User.UserID = UserRoleMap.UserID
Inner Join Role on UserRoleMap.RoleID = Role.RoleID
Where Role.Rolename = $RoleName and Role.AppID = $AppID and User.Username Like $Username;</value>
Changes to Membership/Utiliy/ProviderUtility.cs.
27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
                message += "Exception: " + e.ToString();

                log.WriteEntry(message);
                throw new ProviderException("An exception occurred. Please check the Event Log.");
            }
            else
            {

                throw e;
            }
        }
        public static long GetApplicationID(String ConnString, string AppName)
        {
            long AppID = 0;
            SQLiteConnection conn = new SQLiteConnection(ConnString);
            SQLiteCommand existsCmd = new SQLiteCommand(ApplicationSql.AppExists, conn);







>
|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
                message += "Exception: " + e.ToString();

                log.WriteEntry(message);
                throw new ProviderException("An exception occurred. Please check the Event Log.");
            }
            else
            {
                string msg = String.Format("An exception occured during {0} in {1}. \n Message:{2}", action, source, e.Message );
                throw new ProviderException(msg, e);
            }
        }
        public static long GetApplicationID(String ConnString, string AppName)
        {
            long AppID = 0;
            SQLiteConnection conn = new SQLiteConnection(ConnString);
            SQLiteCommand existsCmd = new SQLiteCommand(ApplicationSql.AppExists, conn);