European Windows 2012 Hosting BLOG

BLOG about Windows 2012 Hosting and SQL 2012 Hosting - Dedicated to European Windows Hosting Customer

European Visual Studio LightSwitch Hosting - Amsterdam :: Windows Authentication in LightSwitch

clock February 25, 2013 04:46 by author Scott

In Part I of this Article, we have seen creation of an application with Forms Authentication i.e. when an application starts it should ask the user to enter login credentials.

In this let us discuss about how to create Windows Authentication Application.

Preparing Solution:

We have already created the project FormsAuthenticatioInLS; use that project to continue the creation of Users, Roles and Permission.

Let's confirm the Table has the following columns.

Setting Windows Authentication:

If the Table is perfect then next check with the Project Properties to confirm that you have selected Use Windows Authentication option.

Windows Authentication is recommended if all your users are on a windows domain and you want to trust that whoever is logged into their computer is the same user that is using the application.

It means you don't have to provide an additional login form. This is handy because you never have to store or manage passwords outside of Windows itself which makes it very secure, however this is usually only practical if the application is running in a corporate/domain Intranet environment.

In Project Properties Windows select Access Control and then select the option Use Windows Authentication.

You have two options with Windows Authentication.

- Allow only users specified in the Users screen of your application.
- Allow any authenticated Windows user.

The first option will let you to create users in our application to authenticate.

The User name must be a valid username in the form of an alias (jagan), domainand alias (jagansvr\jagan), alias and domain ([email protected].com), orfully qualified domain name and alias (sbalram.corp.jagansvr.com\jagan), and it must be less than 256 characters. If you are using Forms authentication, the username must be unique and must be less than 256 characters.

The second option will allow all users in a Windows domain or authenticated by Windows. Press F5 to see the Application in Action.

As we have selected Windows Authentication our application is logged in automatically as a Windows Authenticated user.



European SQL Hosting - Amsterdam :: How to Truncate Log File in SQL Server 2008/2008R2/2012

clock February 22, 2013 07:17 by author Scott

When we create a new database inside the SQL Server, it is typical that SQL Server creates two physical files in the Operating System: one with .MDF Extension, and another with .LDF Extension.
* .MDF is called as Primary Data File.
* .LDF is called as Transactional Log file.
 
Sometimes, it looks impossible to shrink the Truncated Log file. The following code always shrinks the Truncated Log File to minimum size possible.

USE DatabaseName

GO
ALTER DATABASE [DBName] SET RECOVERY SIMPLE WITH NO_WAIT

DBCC SHRINKFILE([DBName_log], 1)

ALTER DATABASE [DBName] SET RECOVERY FULL WITH NO_WAIT

GO

 

 



European Visual Studio LightSwitch Hosting :: Forms Authentication in LightSwitch

clock February 21, 2013 06:40 by author Scott

There are two types of Authentications available in LightSwitch applications.

  1. Forms Authentication
  2. Windows Authentication

In this article, I will discuss the first one, Forms Authentication.

Forms Authentication:

Forms Authentication means that a username/password is prompted for when the application opens and these values are checked against the database.
 
This works nicely for clients running across the Internet that are not on a Windows domain. I'll show you both but first let's choose Forms Authentication.

Setting up LightSwitch Solution:

Create a LightSwitch Desktop Application. And create a table called Person as shown in the following picture.

Design a screen for the created table Person. We will discuss the design in future articles

Select the List and Details Screen from the Screen Template list [No: 1] for getting the Person details as well as the Details of the selected Person.

Give a name for the Screen [No: 2].

Select the Date for the Screen Data ComboBox [No: 3] which is retrieved from the table we have created.

Enabling Authentication:

By default the authentication is not enabled. To enable the authentication just select the project's properties from the Project Menu.
Select Access Control [No: 1] Menu Tab.

From the Access Control Tab, select the Use Forms Authentication option [No: 2].

Yes. We have just done that with enabling the forms authentication. The next step is to create the Permissions for Roles for Users. We will discuss Roles and Users later; first we will see how Permission works.

Adding Permissions:

Permissions are nothing but allowing the user to do something on our LightSwitch application.

In the above picture we have created three permissions Read, Write and Delete. The SecurityAdministration is the default permission provided by the LightSwitch application to create Users and Roles.

We have selected the four permissions to True on Debug mode. So that user can Read, Write and Delete or Add users and roles in Debug mode.
Set the permissions we have created to take effect.

Setting Permissions in Methods:

To add a method to check for the permission, we need to open the table we have created. For this application we have created Person table; just open it.

On the right top corner you can see the Write Code menu. Just click it. You will get a collection of items. From that select Access Control group as shown in this above figure.

Click on People_CanInsert, _CanDelete and _CanRead. These are the default methods provided by LightSwitch.

Now write a line of code as shown in the figure given below.

At the time of creation of Permissions an enumeration of Permissions will be created for us with the Permissions we created in the Access Control Tab in Project Properties.

The first method _CanDelete will check for the currently logged in user whether the user has the permission to do a Delete. If it is true then the application will allow the user to delete.

As like _CanDelete method, the other methods will act.

Now we are ready to Press F5. Just press it.

In Debug mode the LightSwitch application will not show the Login form; it will ask for the user name and password only on Published Application. But permissions that we have selected as granted will havew an affect in Debug mode. Let's see in Action.

As we have enabled all the Permissions the Buttons for Add Edit and Delete are enabled here.

Now deselect the CanDelete permission in Project Properties to check whether it is preventing the user to delete the data.

Here we have deselected the CanDelete Permission. Let's see in Code and Screen.

We can see that the result is false because the Permission CanDelete is deselected.

As the CanDelete Permissions is deselected, the Delete button is disabled in the application.

We have just enabled Permissions in Debug mode but we need to create the user and their roles and permissions for that roles created.

In Part II we will discuss about how to add Users Roles and Permissions for the Roles.



European SSRS Hosting - Amsterdam :: Fixing - Your browser does not support scripts or has been configured not to allow scripts.

clock February 15, 2013 07:51 by author Scott

Sometimes our clients complained about this issue when they run a report in the Report Manager:

Your browser does not support scripts or has been configured not to allow scripts.

So, in today post and hope this help for all of you who facing this problem too. What is the solution??

- go to (from its menu) Tools/Internet Options
- go to Security tab
- select Trusted zone from the list of available zones
- click Sites button
- in new window provide the URL of the Reports Manager (e.g. http://MACHINE_NAME/*); if you are running Reports Manager not on the default port, provide the port number as well

Then, it works like a charm. :)

 



European SQL Hosting - Amsterdam :: How to Fix Cannot resolve the collation conflict between "..." and "..." in the equal to operation

clock February 14, 2013 05:12 by author Scott

Sometimes you’ll get this error message when queries your database:

"Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AI" in the equal to operation"

So, how to fix this error?


Just use the following syntax to collate on the fly when joining up tables with different collations. I integrate system so have to do this allot.

select * from [Product] p join [category] c
on 
c.[Name] collate SQL_Latin1_General_CP1_CI_AS
=
p.[Name] collate SQL_Latin1_General_CP1_CI_AS

Hope this help.



European Cloud Hosting - Amsterdam :: What is Cloud Hosting? The Benefit Using Cloud on Your Environment

clock February 13, 2013 09:25 by author Scott

It seems that everyone is talking cloud these days. Have you been thinking about making the switch over to cloud hosting but not really sure if it’s the right fit for your business? Cloud hosting offers a wide variety of benefits. Let’s take a look at some of the most important ones…

Scaling Resources

The ability to scale resources (such as memory, CPU, and SAN storage space) is an important piece of cloud hosting.

Scalability gives your business the ability to handle major traffic fluctuations during busy seasons. Think a florist website on Valentine’s Day, a swimwear store in the height of summer or a toy store around the holidays for example. Scaling resources ensure full availability, even with an influx of visitors because of a special promotion, ad campaign or media mention. Cloud hosting also allows for resources to be scaled down when the busy season slows – very important to controlling costs.

And scalability in the cloud just got better! The new Microsoft Windows 2012 server management capability offers increased scaling abilities for cloud customers, with up to 64 CPUs and 1TB memory per cloud server.  Click to learn more about our Windows Cloud Servers.

Better Security

Security and safety of data is another benefit that the cloud brings to you. The dedicated environment of the cloud boasts increased security features. With shared hosting, what happens on other customers’ sites can affect your own. Cloud hosting removes this risk and its dedicated environment boasts increased security features. A cloud set-up is loaded with anti-malware software which protects from viruses and other digital threats. Also, all of your business data and records are backed up in case of failure. You get real piece of mind with the security cloud hosting offers.

Automatic Failover

When you’re in the cloud, hardware issues are no longer a major headache. With cloud hosting, you have access to automatic failover. If any piece of hardware should run into issues, your server will automatically migrate to another hardware node in our highly-redundant cluster. This helps to create a fully available, down-time free environment.

Live migration

Live migration is another big benefit driven by cloud hosting and helps to improve the end user experience. Live migration allows hardware maintenance and updates or upgrading of the servers without causing any downtime.

 



European SQL 2012 Hosting - Amsterdam :; Why a Session With sp_readrequest Takes so Long to Execute

clock February 12, 2013 05:36 by author Scott

While applying, Long Running Sessions Detection Job on a production server, we start receiving alert that a session is taking more then 3 minutes. But what actually this session was doing. Here is the alert report.

SP ID

Stored Procedure Call

DB Name

Executing Since

58

msdb.dbo.sp_readrequest;1�

msdb

3 min

sp_readrequest is a system stored procedure, which basically reads a message request from the the queue and returns its  contents.

This process can remain active for a time we have configured for parameter DatabaseMailExeMinimumLifeTime, at the time of database mail profile configuration. 600 seconds is the default value for this external mail process. According to BOL DatabaseMailExeMinimumLifeTime is the The minimum amount of time, in seconds, that the external mail process remains active.

This can be changed, at the time of mail profile configuration or you can just use update query to change this time.

UPDATE msdb.dbo.sysmail_configuration
SET
paramvalue = 60 --60 Seconds
WHERE paramname = 'DatabaseMailExeMinimumLifeTime'


We have changed this to 60 seconds to resolve our problem.

 



European ASP.NET Ajax Hosting :: JQuery Ajax not work in IE, but work in Firefox, Chome, Safari. Why??

clock February 8, 2013 08:03 by author Scott

You may have come across the situation where you are making a jQuery AJAX GET request to update part of your page with changing content, but it never updates or just returns blank content.

What it actually comes down to is that the ‘Get’ call is working correctly, but Internet Explorer (IE) caches the response, so you never get the updated results from the server.

What are the options:

1. Use POST rather than GET – although this is not semantically correct, you should only POST when modifying contents on the server, technically there really is not much difference.

2. (Preferred) You can disable caching globally using $.ajaxSetup(), for example:

$.ajax

Setup({ cache: false });


This appends a timestamp to the querystring when making the request. To turn cache off for a particular $.ajax() call, set cache: false on it locally, like this:

 $.ajax({
cache: false,
//other options...
});



Smarter Mail Issue :: Smartermail Attachments not working

clock February 6, 2013 07:59 by author Scott

Sometimes, permissions can become corrupt for SmarterMail which prevents attachments from being displayed in webmail.  This article goes over fixing this. 

Steps
An error like this can sometimes be seen when trying to get the attachment:
XML Parsing Error: no element found

Before you proceed, do a SmarterMail self-diagnostic (also known as checkup page), this will help you identify the problem.

  1. Log in to SmarterMail as the system administrator.
  2. Click Settings (top left).
  3. Under Activation click SmarterMail Self Diagnostic.

This will launch a separate window showing you the problem.

For permissions:

  • C:\Program Files (x86)\SmarterTools\SmarterMail\MRS\MailProcessing
  • C:\Program Files (x86)\SmarterTools\SmarterMail\MRS\App_Data

Please apply the permission (read and write) to your user, network service, IUSR. Then, please run again Self Diagnostic test.

 



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in