Skip to main content

Posts

Recent posts

Read All Tables from SQL with respect of table rows or table size

Dear All,
If you need to read how many tables of SQL in your database has major record this script will help you.


SELECT
    t.NAME AS TableName,
    s.Name AS SchemaName,
    p.rows AS RowCounts,
    ist.TABLE_CATALOG as tableCatalog,
    SUM(a.total_pages) * 8 AS TotalSpaceKB,
    SUM(a.used_pages) * 8 AS UsedSpaceKB,
    (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB
FROM
    sys.tables t

INNER JOIN    
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN
    sys.allocation_units a ON p.partition_id = a.container_id
INNER JOIN
  INFORMATION_SCHEMA.TABLES ist on ist.TABLE_NAME = t.name

LEFT OUTER JOIN
    sys.schemas s ON t.schema_id = s.schema_id
WHERE
    t.NAME NOT LIKE 'dt%'
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID > 255
GROUP BY
    t.Name, s.Name, p.Rows, ist.TABLE_CATALOG
ORDER BY
    p.rows desc


I hope it will work for your

Regards
Rashid imran Bilg…

SQL SERVER – Cannot resolve collation conflict for equal to operation

Dear All,

In MS SQL SERVER, the collation can be set at the column level. When compared 2 different collation column in the query, this error comes up.

SELECT ID
FROM ItemsTable
INNER JOIN AccountsTable
WHERE ItemsTable.Collation1Col = AccountsTable.Collation2Col


If columns ItemsTable.Collation1Col and AccountsTable.Collation2Col have different collation, it will generate the error “Cannot resolve collation conflict for equal to operation“.

To resolve the collation conflict add following keywords around “=” operator.

SELECT ID
FROM ItemsTable
INNER JOIN AccountsTable
WHERE ItemsTable.Collation1Col COLLATE DATABASE_DEFAULT
= AccountsTable.Collation2Col COLLATE DATABASE_DEFAULT

I hope the above solution will help you and save your time 
Regards  Rashid Imran Bilgrami

RegisterStartupScript updated way to right Java script JS (Javascript) in code behind also work with update panel

Dear All
RegisterStartupScript is obsolete now the new way that works with update panel  is given below its is code behind file code also

VB Code Dim csname1 As String = "PopupScript"
Dim cstype As Type = Me.GetType()
Dim cs As ClientScriptManager = Page.ClientScript
Dim cstext1 As String = "alert('Your message');"
cs.RegisterStartupScript(cstype, csname1, cstext1, True)

C# Code
String csname1 = "PopupScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
String cstext1 = "alert('Hello World');"; cs.RegisterStartupScript(cstype, csname1, cstext1, true);
I hope it will help you also 
Regards  Rashid Imran Bilgrami

How to Create Window Service and execute it

Dear All
If you are looking for develop you own window service than below is the simplest method to create it

The original reference for this post is following
http://www.c-sharpcorner.com/UploadFile/naresh.avari/develop-and-install-a-windows-service-in-C-Sharp/


Here we go... This article explains a step-by-step process of developing and installing a Windows Service to do a scheduled job based on a time interval.

Open Visual Studio and from the menus select "File" -> "New" -> "Project...".

A New Project window will open. Choose "Visual C#" >> "Windows" project type and select "Windows Service" from the right hand side and name the project "TestWindowsService" as shown in the following screenshot.







After you click "OK", the project will be created and you will see the design view of the service as shown in the following screen. Right-click the "Service1.cs" file in Solution Explorer and…

SEND SMS or Call HttpWebRequest on Proxy Server or ISA Server

Dear All 
I tried to access the HttpWebRequest to send the SMS the code was working fine with my online website but when i run it with my local server and the LAN server i got and server not responding error

Original Solution Post 
http://stackoverflow.com/questions/20336826/httpwebrequest-cannot-connect-through-proxy

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond IP Address:80
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond IP ADDRESS:80

After quick review of my code i found…

Mobile APP development with Visual studio.net 2015

Dear All This is an awesome video for the one VS application tool for development the code of all mobile devices 

I hope it will work for you

Regards
Rashid Imran Bilgrami