Resizing GridViews Columns

If your Gridview is not behaving as it should (the widths of the columns are out of control), this method below should help you Fix that.

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
       foreach (TableCell myCell in e.Row.Cells)
        {
            // Takes cares if wrapping the long Cells
             myCell.Style.Add("word-break", "break-all");
            // set the height of my Cells
             myCell.Style.Add("height", "50px");
        }

       // set each with based on the maximun size of each data
       // In this case i have 6 columns on my gridview that i have to fit in "800px"

       GridView1.Columns[0].ItemStyle.Width = 30;
       GridView1.Columns[1].ItemStyle.Width = 30;
       GridView1.Columns[2].ItemStyle.Width = 100;
       GridView1.Columns[3].ItemStyle.Width = 50;
       GridView1.Columns[4].ItemStyle.Width = 80;
       GridView1.Columns[5].ItemStyle.Width = 200;
    }

Property or indexer cannot be assigned to — it is read only

When trying to set up a property variable let’s say “Properties.Settings.Default.YcsoftwareDb = DbLocation.FileName” for example you may get the error message: “Property or indexer cannot be assigned to — it is read only”. To fix the issue make sure that the application scope of you settings variable is set to  “User” instead of “Application”

The crucial distinction between application-scope and user-scope settings is that user-scope settings are read/write at run time, and their values can be changed and saved in code. Application-scope settings are read only at run time. While they can be read, they cannot be written to. Settings with application scope can only be changed at design time, or by altering the settings file manually.”

Microsoft (http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx)

Reporting Services Headers and Footers

Adding Header and Footers on your reports.
http://technet.microsoft.com/en-us/library/ms156326.aspx

According to the article,  “On the design surface, right-click the report”.  The “design surface” is shown below.

If you are working with 8.5 by 11 pages,  make sure that you work within 7.5 Inches and set up you margin to be 0.5 inches left and 0.5 inches right, you will avoid a lot of headaches.

Note that you can set up the report margin using the report properties.  Right click on the area shown above and select report properties or go to the report on the menu bar and select  “Report Properties”.  You will find them under the layout tab.



Restore Transaction Logs Grayed out (Disabled) in SSMS

You need to restore the transaction logs and when you ready to do so, you pull up SSMS (SQL Server Management Studio) and see the following:

restore transaction log grayed out

So now what!

FYI: You cannot restore Transaction logs directly. The Transaction logs depends on the full backup and you will have to restore the full backup first and then the transaction log will be enabled in SSMS.

Requirements
Make sure that you have a full backup of the database  available
Make sure that you have a backup of your transaction logs available
  1. First Make sure that you have “Recovery Model” set to “Full”. Right Click on the database name , click on properties and you see the following:

  2. Restore the Full Backup.
  3. If you go back to SSMS -> Restore   and you should see that “transaction log” is no longer grayed out.

  4. Now you are ready to proceed.

References :
http://technet.microsoft.com/en-us/library/ms186858.aspx

No more connections can be made to the remote computer

“Note for Windows XP Professional, the maximum number of other computers that are permitted to simultaneously connect over the network is ten. This limit includes all transports and resource sharing protocols combined. For Windows XP Home Edition, the maximum number of other computers that are permitted to simultaneously connect over the network is five. This limit is the number of simultaneous sessions from other computers the system is permitted to host. This limit does not apply to the use of administrative tools that attach from a remote computer.” Taken directly from Microsoft
http://support.microsoft.com/kb/314882

To find out about Windows Server Connections limits check the following link:

http://smallvoid.com/article/winnt-tcpip-max-limit.html