Apr 16

SqlProfileProvider (vb) storing additional profile information

The last few weeks I have been looking at capturing additional user information to the default username, password and email combination of the default SqlProfileProvider login process.  The process of creating a simple login account and storing it with SqlProfileProvider is so simple and better documented that I wont go into this.

This is a brief introduction on how to use the inbuilt profile functionality of .net to store additional profile information

In a nutshell it is very easy to add additional fields to capture additional information in 3 easy steps.

1)Add a few lines of code into the web.config file

  • <connectionStrings>
    • <add name=”ApplicationServices” connectionString=”packet size=4096;Data Source=sqlserver;Initial Catalog=database;Persist Security Info=True;User ID=sa;Password=password;Max Pool Size = 500;Connection Timeout = 60″ providerName=”System.Data.SqlClient”/>
  • </connectionStrings>

This sets the connection string to the database where the profile will be stored

  • <profile enabled=”true”>     
    • <providers>
    • <clear/>
    • <add name=”AspNetSqlProfileProvider” type=”System.Web.Profile.SqlProfileProvider” connectionStringName=”ApplicationServices” applicationName=”/”/>
  • </providers>       

This enables profiles and selects the connection string to use.

  • <properties>         
    • <add name=”FirstName” type=”String”/>         
    • <add name=”Surname” type=”String”/>        
    • <add name=”Location” type=”String”/>      
    • </properties> 
  • </profile>

The properties section contains the fields that are required to store the additional information against the users profile.

2) After you have dragged a createuserwizard from the toolbox onto a page convert to a template. Just edit the template and add the additional fields:-

  • <tr>     
    • <td align=”right” style=”height: 26px”>         
      • <asp:Label ID=”FirstNameLabel” runat=”server” AssociatedControlID=”Location”>First Name:</asp:Label>     
    • </td>     
    • <td style=”height: 26px”>         
      • <asp:TextBox ID=”FirstName” runat=”server”></asp:TextBox>         
      • <asp:RequiredFieldValidator ID=”FirstNameRequired” runat=”server”             
        • ControlToValidate=”FirstName” ErrorMessage=”First Name is required.” ToolTip=”First Name is required.” ValidationGroup=”CreateUserWizard1″>*
      • </asp:RequiredFieldValidator>     
    • </td> 
  • </tr>

I have only shown 1 additional field in the sample above.

3)We have defined were to store the profile and how to capture the additional fields. We just need to put the data in the database. In the code behind file for the create user file:-

  • Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
    • Dim myProfile As ProfileCommon = CType(ProfileCommon.Create(CreateUserWizard1.UserName, True), ProfileCommon)
    • ‘ custom user registration fields         
    • myProfile.FirstName = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(“FirstName”), TextBox).Text
    • myProfile.Surname = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(“Surname”), TextBox).Text
    • myProfile.Location = CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl(“Location”), TextBox).Text
    • myProfile.Save()
  • End Sub

When a user is created it will now create the user account in the aspnet_Users table and the additional profile information in the aspnet_Profiles tables.

All tables that are prefixed aspnet_ are system generated tables.

My definition has used a single page to register the user and gather the additional information at the same time.

The createuserwizard is a good tool and the process can be spread over several pages/steps.

Mar 05

Paravirtualized I/O

If you have used vmware or any other bare metal hypervisor you will probably come across references to paravirtualization.  In this short document I have tried to explain the key difference between fully virtualized and paravirtualized I/O

Fully Virtualised I/O

In a fully virtualized system, the disk driver for example believes that it is controlling a real hard drive.  However it is the hypervisor that notices that that a disk read/write operation has been requested instead of a real disk controller. The hypervisor notifies the virtual hardware, which then performs the requested operation i.e. a disk read/write.  As you can see a disk read request happens twice, from the virtual machine to the hypervisor and from the hypervisor to the physical device.  The benefit of full virtualisation is that by emulating the real-world hardware, pre-existing guest OS drivers can be used, providing greater compatibility and ease of configuration.

Paravirtualized I/O

With paravirtualization the physical Device “Drivers” have been split into 2 parts called PV Drivers.  The front-end driver is loaded into the VM and the Back-end driver is located within the hypervisor talking directly to the physical device. paravirtualization (PV Drivers) reduce the guest I/O latency as there is only the one request from the guest VM to the physical hardware.  The downside of paravirualisation is that you need new drivers for each operating system you want to use as a guest as opposed to the devices provided by a fully virtualized system which tend to be common enough that the drivers will be available for nearly every OS. Paravirtualization greatly expands the range of tasks that virtual machines can be used for and will one day  make gaming, CAD, and visualization possible within a VM

Feb 24

Annex M – too good to be true ?

Annex M is a variant on an ADSL service that allows you to trade in some of the downstream bandwidth for an increase in the upstream bandwidth.

I have been evaluating this for the past 3 months and whilst the theory is good and the performance increase/cost saving over a SDSL, EOC or serial line are very appealing in practice its not quite there.

Packet fragmentation, drop outs & high ping rates are just a few of the issues experienced.  In certain circumstances this may not be too much of a problem but in a citrix environment the end users can feel the paid.  In fact they prefer the occasional slow up on a standard ADSL service than the frequent complete lost of a citrix session.

annex-m variant routers are required to support the service such as the Cisco 887VA-M. During our implementation testing we tried this model of router in fact, several of them and even replaced the branch switches and cabling to rule out any problems with existing infrastructure.

If your considering this then I would strongly recommend testing first before committing to any large rollout

 

 

Feb 24

SMSQL Backup failures – Could not create component: 0x8007007E

If you have email reporting enabled on failures you may see something similar to: -

#8 : [SQL02 - Demo] Error : Could not create component: 0x8007007E

 #9 : [SQL02 - Dev] Error : Could not create component: 0x8007007E

 Databases skipped in the Backup:The backup of one or more databases failed.

On the Filer Syslog console there could also be errors such as:-

Sun Feb 19 10:00:45 GMT [useradmin.unauthorized.user:warning]: User 'domain\account' denied access - missing required capability: 'api-system-get-version'
within the SMSQL backup log there was also messages stating that SQLVDI.DLL was a missing component or was not registered.

After some investigation I decided that error was not related to SMSQL but a pure SQL Server problem.
I re-registered the vdisql.dll file with regsvr32 without stopping SQL server service but to no avail.  In fact this caused the enterprise management console for SQL to stop functioning.
A reboot resolved both backup failures and associated error messages and restored functionality of the SQL enterprise management console.
I have a feeling that a straight forward reboot would have solved the problem but unless it happens again I will never know.






						
						
						
		

Jan 17

Snapmirror initialisation error

I recently encountered a problem snapmirroring between a 2020 in domain x and a 3140c in domain y.

It was an interim configuration as part of a larger project.  Snapmirror was being used as a way of swinging between the two filers in a production environment to minimise downtime.  The fact that the filers were in different AD domainshad no part in the problem.

Preiliminary work such as configuring hosts files, dns and nfs exports had been completed.

Entries had been added to the etc/snapmirror.allow configurationg file

Destination volumes had been created and restricted.

On initialising the snapmirror the following error was encountered:-

 “snapmirror may be misconfigured, the source volume may be busy or unavailable”

As well as editing the snapmirror.allow file I also needed to add a reference to the destionation filer as follows:-

options snapmirror.access host=systemA

systemA can be an ipaddress or Filer name.

 However, I was still getting failures when initialising the snapmirror. 

With a telnet session open to the source filer I attempted the snapmirror initialisation again. 

Whilst I expected another failure it showed that the destination requesting the snapmirror initialisation was coming from a different IP address than expected.

After adding this IP address to the .access option the snapmirror initialsied succesfully.

 

Older posts «