Wednesday, September 28, 2016

RadGrid NoRecordsTemplate Not Showing

Add a NoRecordsTemplate setting to the MasterTableView of your Telerik RadGrid to provide an informative display when your grid DataSource has no records.
The NoRecordsTemplate will only show when your grid DataSource indicates there are no records.

I prefer to initialize the grid DataSource to empty at the start of the NeedDataSource event handler and replace the DataSource value if data is available for the grid.

For example, I use the following line to set myGrid DataSource to indicate no records.
     myGrid.DataSource = new object[0]{};




Contact Blue Canyon Software if you need custom software development for your business.

Thursday, May 5, 2016

Performance Tuning for ASP.NET

Found a good article at c-sharpcorner.com  with lots of suggestions for improving performance of an ASP.NET web site.      Click this link to see the article. 


Visit www.BlueCanyonSoftware.com if your business needs custom software development.

Tuesday, March 29, 2016

Case Insensitive SQL Search for Missing Values in Another Table

Problem: 

You need to compare two tables to find values in one table that are missing in the other table.   SQL server default is case insensitive so if "Dog" is in table A and "DOG" is in table B there is a match.    

Solution:  

You need to set the COLLATE value to get your desired result of a case sensitive comparison. 

We will compare two tables,  The graniteRequested table has a 'Color' column.  The colorGranite table has a 'color' column.   

This SQL query will look for colors that are in the graniteRequested table but not in the colorGranite table. 

SELECT DISTINCT gR.Color   
  FROM graniteRequested gR
  WHERE gR.Color NOT IN 
  (SELECT colorGranite.color   Collate SQL_Latin1_General_CP1_CS_AS   FROM colorGranite)


 Collate SQL_Latin1_General_CP1_CS_AS   makes this a case sensitive search. 


Visit www.BlueCanyonSoftware.com if you need custom software development for your business.


Tuesday, February 2, 2016

List SQL Server Database Tables and Columns

Query for Showing All Tables and Columns in Your Database

Do you need a list of all the tables in your database and their columns?

Use SQL Server Management Studio to connect to your database.   Execute this query, substituting your database name in the USE statement.


USE YOUR_DATABASE_NAME;
SELECT OBJECT_SCHEMA_NAME(T.[object_id],DB_ID()) AS [Schema],
        T.[name] AS [table_name], AC.[name] AS [column_name],
        TY.[name] AS system_data_type, AC.[max_length],
        AC.[precision], AC.[scale], AC.[is_nullable], AC.[is_ansi_padded]
FROM sys.[tables] AS T
  INNER JOIN sys.[all_columns] AC ON T.[object_id] = AC.[object_id]
 INNER JOIN sys.[types] TY ON AC.[system_type_id] = TY.[system_type_id] AND AC.[user_type_id] = TY.[user_type_id]
WHERE T.[is_ms_shipped] = 0
ORDER BY T.[name], AC.[column_id]


Right-click on the query results grid and select "Save Results As..."
Choose the .csv file format so you can open the file in Excel.



Visit www.BlueCanyonSoftware.com if you need custom software development for your business.