Friday, July 5, 2019

How to add ads.txt to blogger.com?

Set up an ads.txt file

If your blog is monetized with third-party providers or you’ve manually integrated AdSense in your blog, you will need to manually set up the content of the ads.txt file.
  1. Sign in to Blogger.
  2. In the top left, click the Down arrow  .
  3. Click the blog you want to set up an ads.txt file on.
  4. On the left, click Settings.
  5. Under "Settings," click Search preferences.
  6. Under "Monetization," find "Custom ads.txt" and click Edit.
  7. Click Yes.
  8. Copy the settings from your third-party monetization provider and paste them in the text box.
  9. Click Save settings.
  10. Optional: To check the content of your ads.txt file, go to http:///ads.txt.
Note: If your blog is not monetized, or it’s only configured to use AdSense using the Blogger-AdSense integration, then you do not need to manually set up ads.txt. Blogger will do this for you. Read more about ads.txt for AdSense.

Sql-Server the Select permission was denied on the object 'types', Error 229

Please check that you didn't check the following  DB role:
1. db_denydatareader
2. db_denydatawriter

Please uncheck both of them, this will solve your problem.
















Steps to uncheck the roles:
  1. Open SQL Management Studio
  2. Expand your database
  3. Expand the "Security" Folder
  4. Expand "Users"
  5. Right click the user (the one that's trying to perform the query)
  6. Make sure you uncheck

Saturday, April 27, 2019

Contact Form 7 reCAPTCHA not showing


Contact Form 7 latest version not supporting the reCAPTCHA, So, We need to downgrade the Recaptcha plugin,

Steps to Rollback the Contact Form 7 :

  1. Install the Plugin "wp rollback".
  2. After Installing go to the plugins, you will find an option below all the plugins for rollback.
  3. So, rollback the Contact Form 7  from 5.1 to 5.0.5
  4. After this go to integration on the contact form and paste your keys again like you did in the beginning.
  5. Open your contact form on the backend and save it again. Make sure you add the recaptha again
  6. Now go to your front-end and refresh your page.And your done!
Wait for next update with the fix.

No need te install any other plugins.


Friday, April 12, 2019

RadTimePicker, showing error as " 'SelectedDate' should be between 'MinDate' and 'MaxDate'".

The default minimum date for the RadDatePicker is 01/01/1980. So, when you try to assign the value this than this date you will get the below error:


if you will set the Mindate of RadDatePicker to a minimum range than this will fix the issue

ID="RadDateofBirth" DateInput-DateFormat="dd/MM/yyyy" MinDate="01/01/1940" DateInput-DisplayDateFormat="dd/MM/yyyy" runat="server">

This will solved the issue.

Thursday, April 11, 2019

Microsoft SQL Server - How to check all empty tables in database?

Process to check all empty tables in a Database:

1. Select the database in the SSMS and open the "New Query" window.
2. Run the below query.

SELECT sch.name as SchemaName, t.NAME AS TableName,  p.rows AS RowCounts
FROM   sys.tables t
INNER JOIN  sys.partitions p ON t.object_id = p.OBJECT_ID
INNER JOIN sys.schemas sch on t.schema_id = sch.schema_id
WHERE  t.NAME NOT LIKE 'dt%'   AND t.is_ms_shipped = 0   AND p.rows <=0
GROUP BY  sch.name,t.Name, p.Rows
ORDER BY  sch.name,t.Name

Friday, April 5, 2019

System.InvalidOperationException: 'String[n]: the Size property has an invalid size of 0.'


This error occurs generally when we are not passing the Output parameter in the SqlDbType.VarChar value like the below example

SqlParameter job1 = cmd2.Parameters.Add("@job", SqlDbType.VarChar);
job1.Direction = ParameterDirection.Output;

You need to define a length when specifying SqlDbType.VarChar parameter, So

SqlParameter job1 = cmd2.Parameters.Add("@job", SqlDbType.VarChar, 50);
You should use the same length as defined in your SQL Server stored procedure.

How to Import and Export SSL Certificates in IIS 7

How to Import and Export SSL Certificates in IIS 7

This Article Explains how to export your certificate from working server, import the certificate to another server, and then enable the certificate for use on the new server.
Exporting/Backing Up to a .pfx File
  1. On the Start menu click Run and then type mmc.
  2. Click File > Add/Remove Snap-in.
  3. Click Certificates > Add.
  4. Select Computer Account and then click Next. Select Local Computer and then click Finish. Then close the add standalone snap-in window and the add/remove snap-in window.
  5. Click the + to expand the certificates (local computer) console tree and look for the personal directory
    Warning: Do not select the delete private key option.
  6. Leave the default settings and then enter your password if required.
  7. Choose to save the file and then click Finish. You should receive an "export successful" message. The .pfx file is now saved to the location you selected.
Importing from a .pfx File
  1. On the Start menu click Run and then type mmc.
  2. Click File > Add/Remove Snap-in.
  3. Click Certificates > Add.
  4. Select Computer Account and then click Next. Select Local Computer and then click Finish. Then close the add standalone snap-in window and the add/remove snap-in window.
  5. Click the + to expand the certificates (local computer) console tree and look for the personal directory/folder. Expand the certificates folder.
  6. Right-click on the certificate you want to backup and select ALL TASKS > Import.
  7. Follow the certificate import wizard to import your primary certificate from the .pfx file. When prompted, choose to automatically place the certificates in the certificate stores based on the type of the certificate.
Installing the Certificate with Website
  1. On the Start menu click Run and then type inetmgr.
  2. In the IIS Manager, click the server name.
  3. Expand the sites folder.
  4. Select the site that you want to secure (usually the default website).
  5. On the actions menu in the edit site section, click Bindings.
  6. In the site bindings window, click Add. If a binding for https already exists, select the https binding and click Edit.
  7. Fill out the information in the add site binding window. In the type drop-down choose https. Set the IP address to the IP address of the site or choose all unassigned. The port for SSL traffic is usually 443. Enter the recently imported certificate in the SSL Certificate field.
  8. Click OK. Your SSL Certificate is now installed and the website is configured to accept secure connections. You may have to restart IIS or the server for it to recognize the new certificate.

Saturday, March 30, 2019

HTTPS with Visual Studio's built-in ASP.NET Development Server


You need to enable the SSL in the project by using the below steps:
  • Enable the SSL with in IIS Express, you have to just set “SSL Enabled = true” in the project properties window.
  • Then you can start your project with IIS Express normally and it will start using SSL, the new Port will be 44301
Note : https and http both ports are generally different. By default SSL enabled is set to false with IIS Express; so if you run your web application first time, you will only be able to find the default URL and you can access the site over http.

Thursday, March 14, 2019

Ms Sql Server - The Visual Studio Component is out of date. Please restart Visual Studio. (Mscorlib)

SSMS Error: "The Visual Studio Component is out of date. Please restart Visual Studio. (Mscorlib)"

When you are trying to open Query or execute query in Microsoft SQL Server Management Studio, you may see the following message:

The Visual Studio Component is out of date. Please restart Visual Studio. (Mscorlib).

Cause: Sometimes cache of the Sql Server corrupted due to Updates in the visual studio or Sql-Server components updates.

Solution : 

STEP 1: Delete the Temp Files. Shortcut to delete the temp files


STEP 2: Restart Microsoft SQL Server Management Studio and the error message will have disappeared.