- Details
- Written by: Stanko Milosev
- Category: SQL
- Hits: 6505
If you are receiving error like:
Failed to add rule 'xxx.xxx.xxx.xxx to xxx.xxx.xxx.xxx' to firewall. Please add it manually.
Then first go to SQL databases, like on the picture:

After go to servers, and click on the server which you want to configure:

Then click configure:

And here you can add your rule:

- Details
- Written by: Stanko Milosev
- Category: ASP.NET
- Hits: 3156
Set breakpoints and attach to process w3wp.exe:
If you don't see w3wp.exe then either refresh browser, or open your application in browser, and click refresh in "Attach to process" window.
- Details
- Written by: Stanko Milosev
- Category: ASP.NET
- Hits: 6113
In this article I have a bug :) Because I had a model like:
public String ReportSuccessToAddress { get; set; }
then in controller I had:
xmlReportSuccessCcAddress.Descendants("Value").Single().Value = startReportModel[i].ReportSuccessCcAddress;
In case that ReportSuccessCcAddress is null this line will fail. To automatically change null to empty string, in your model add annotation like:
[DisplayFormat(ConvertEmptyStringToNull = false)]
public String ReportSuccessToAddress { get; set; }
- Details
- Written by: Stanko Milosev
- Category: ASP.NET
- Hits: 6791
In your model, if you want to have e - mail validation, if user entered valid e - mail, you can use following regular expression:
[RegularExpression("^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+)*$",
ErrorMessage = "You must enter a valid email address for send Error Mail address. Multiple mail addresses must be separated with semicolons (no spaces)!")]
One example of the model is:
public class DistributionListsEditModel
{
[DataType(DataType.Text)]
public String Name { get; set; }
[DataType(DataType.EmailAddress)]
[RegularExpression("^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+([;|.](([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+)*$",
ErrorMessage = "You must enter a valid email address for send Success Mail address. Multiple mail addresses must be separated with semicolons (no spaces)!")]
public String ReportSuccessToAddress { get; set; }
[DataType(DataType.EmailAddress)]
[RegularExpression("^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+)*$",
ErrorMessage = "You must enter a valid email address for send Error Mail address. Multiple mail addresses must be separated with semicolons (no spaces)!")]
public String ReportErrorToAddress { get; set; }
[DataType(DataType.EmailAddress)]
[RegularExpression("^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+)*$",
ErrorMessage = "You must enter a valid email address for send Success CC Mail address. Multiple mail addresses must be separated with semicolons (no spaces)!")]
public String ReportSuccessCcAddress { get; set; }
[DataType(DataType.EmailAddress)]
[RegularExpression("^(([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\\-\\.]+)@([a-zA-Z0-9_\\-\\.]+)\\.([a-zA-Z]{2,5}){1,25})+)*$",
ErrorMessage = "You must enter a valid email address for send Error CC Mail address. Multiple mail addresses must be separated with semicolons (no spaces)!")]
public String ReportErrorCcAddress { get; set; }
}