Ultimate Collection - { fslBlog & faisalmb.com } Ultimate Collection - { fslBlog & faisalmb.com }   
Blog   |   Site   |   Posts (348)   |   Tags Xplorer   |   Feed Subscribe Free! Welcome buddy @ home... Sign in    Partner Site - Real Home Contact Search   

Fri

20

Jun

2008

Mon-13-02-2012
   

Find rowcount, columncount, table size in Sql Server Database



Today I tried to find out which table is taking much space in DB or to find the numbers of columns and rows in all tables of DB

Following query will return the required result

=========

USE DatabaseName
GO
CREATE TABLE #temp (
                table_name sysname ,
                row_count INT,
                reserved_size VARCHAR(50),
                data_size VARCHAR(50),
                index_size VARCHAR(50),
                unused_size VARCHAR(50))
    SET NOCOUNT ON
INSERT     #temp
    EXEC       sp_msforeachtable 'sp_spaceused "?"'
SELECT     a.table_name,
            a.row_count,
            COUNT(*) AS col_count,
            a.data_size
    FROM       #temp a
            INNER JOIN information_schema.columns b
            ON a.table_name collate database_default
    = b.table_name collate database_default
    GROUP BY   a.table_name, a.row_count, a.data_size
    ORDER BY   CAST(REPLACE(a.data_size, 'KB', '') AS integer) DESC
DROP TABLE #temp

 

 

 


Thu

28

Jan

2010

Mon-13-02-2012
   

Controls not functional after Export to Excel or Export to PDF of Telerik in Sharepoint Application page



Few days before, I was having problem that after clicking on Export to pdf button / image, other controls of web part/user control stops working on the application page on WSS 3.0 environemnt that has RadGrid on it.

While the same thing was working on other asp.net application outside the sharepoint environment.

1st workaround (can be a solution)

The cause for this behavior is that there is a flag (named _spFormOnSubmitCalled) in SharePoint which prevents double form submition. This flag is set when the form is submitted and clear when the response is received.
However when exporting the response is redirected and the page is not updated, thus the flag is not cleared and page's postbacks are blocked.

In order to workaround this behavior you should manually clear the flag when exporting. This can be achieve, for example in export button's client click function similar to the following:

MyExportButton.OnClientClick = "_spFormOnSubmitCalled = false;"  

Above workaround will allow you to export multiple times, but all the other controls on the page were still not functional after the export.

2nd workaround (Not / Never recommended)

In your sharepoint master page, remove onsubmit attribute from your form tag

<form runat="server" onsubmit="return _spFormOnSubmitWrapper();"> 

and remove the onsubmit attribute.  This is what it looks like now:

<form runat="server"> 

3rd workaround (so far so good and implementable)

Add the following script to your webpart / custom control that need to have export and other controls functionals, rather then implementing the above workarounds
So here you go with the working solution.

<script type="text/javascript" language="javascript">

    //sharepoint postback to work after clicking on telerik export to pdf
    if (typeof (_spBodyOnLoadFunctionNames) != 'undefined' && _spBodyOnLoadFunctionNames != null) {
        _spBodyOnLoadFunctionNames.push("supressSubmitWraper");
    }

    function supressSubmitWraper() {
        _spSuppressFormOnSubmitWrapper = true;
    }
   
</script>

 

Hope this will helps.

 


Thu

11

Feb

2010

Mon-13-02-2012
   

Sharepoint - SPWeb.Groups Vs SPWeb.SiteGroups



SPWeb has two sharepoint cross-site group collection, SPWeb.Groups and SPWeb.SiteGroups.

SPWeb.Groups returns collection of cross-site groups which has some permission on the site. So if you add group from a site without any permission on the site, then this group wont appear in SPWeb.Groups collection, but it will appear in SPWeb.SiteGroups collection.

You can not use SPWeb.Groups.Add method to add new cross-site group, you need to use SPWeb.SiteGroup.Add method for this purpose.

In addition to this SPWeb has a property AssociatedOwnerGroup, which will return the required SPGroup. You can iterate the SPGroup users to get the list of all owners of the site.

 foreach (SPUser user in web.AssociatedOwnerGroup.Users)
 {
      // .. list all the users                        
 }

 

Finding and adding group

SPGroup  group = GetSiteGroup(web, "groupName");
if (null == group)
{
 web.SiteGroups.Add("groupName", web.AssociatedOwnerGroup, null, "Test Group description");
}

 


private static SPGroup GetSiteGroup(SPWeb web, string name)
{
    foreach (SPGroup group in web.SiteGroups)
    {
 if (group.Name.ToLower() == name.ToLower())
 {
     return group;
 }
    }
 return null;
}

 

 


Wed

20

Apr

2011

Mon-13-02-2012
   

Sigin as different user in asp.net using Windows authentication



If you want to have signin as different user functionality like sharepoint in your asp.net application, following workaround you might be looking for.
After setting your web.config file's 

<authentication mode="Windows" />

and in IIS after remove anonymous authentication and enable windows authentication, have following code snippet where you want to have this functionality

In your aspx page

    <div>You are logged in as <br /> <%=User.Identity.Name%> <br /><br /> 
    <asp:LinkButton ID="lnkSignOut" runat="server" Text="Sign in as different user" onclick="lnkSignOut_Click"></asp:LinkButton>


In your code behind file

 protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
        Session["logOutRequested"] = false; //Initialize value. This will be set to true when user will click on sign in as differnet user
    }
}


protected
void lnkSignOut_Click(object sender, EventArgs e)
{
    if (null != Session["logOutRequested"] && !Convert.ToBoolean(Session["logOutRequested"])) // Check if user is clicking link first time
    {
        Session["logOutRequested"] = true; //Set value that user want to sign in as differnet user
        Response.StatusCode = 401;
        Response.StatusDescription = "Unauthorized";
        Response.End();
    }
    else
    {
        Session["logOutRequested"] = false; //Initialize value again after user is authenticated with differnet or same user again.
    }
}


Hope this workaround will help.

In case if above workaround is not working, you may try following one
www.roelvanlisdonk.nl/?p=825

 

 

 


Wed

27

Aug

2008

Tue-07-02-2012
   

Umrah Procedure



Umrah Procedure
Umrah ka tareeqa


Following are the valuable summarized information for those who is going for Umrah (maashaAllah) as some time authentic information is difficult to find.
Following images/files are just the extraction of Niyat, Duas and important terms. For full information please get the "authenticated" Umrah book and read that completely before going.
The images files can be saved to mobile/cell phones which may help you in Masjid-al-Haraam / Masjid-e-Nabwi sallaLlaho alaihi wassallam.

For user assistance, these are also available to download in both PDF file and HTML/JPG files within zip file.


(Download Links)

http://faisalmb.com/scrd/religious/files/Umrah Procedure.pdf
http://faisalmb.com/scrd/religious/files/Umrah Procedure.zip


Summarization :-
1) Where ever niyat word is used, it must be in/from heart. It would be good if to read / say niyat words from mouth.

2) Pray 2 or 4 rakaat namaz-e-nafil before leaving. (Optional)

3) Have ahram before entring haram hudood i-e before or at meeqat.

4) Offer 2 rakaat. In first rakaat read Soorah-Al-Kaafiroon (qul ya aiyuhal kaafiroon), in second rakaat read Sorrah-Ahad (qul huwaLlaho ahad)

5) Do niyat for ahram / umrah.

6) Say labbaik (atleast three times just a bit loud for men, for female in her voice that she can hear only)

7) Read duroon.

8) Now leave from meeqat.

9) Before entering Masjid-al-Haraam, read dua for entering in Masjid,

10) On first sight on Kaaba, pray whatever you want in whatever language. Ask from God because Allah want you to ask.
Say subhanAllah, Allah-o-Akbar, Durood

11) Now to start tawaf, do niyat for tawaf (Mendatory). Wudu is mendatory for Tawaf. Preferebbaly remain ba wudu through out the preiod.

12) Go to Hajr-e-Aswad (Stone from Jannah). If possible kiss, if not possible then touch it or point out to it (that is called istilaam).
bismiLlahi Allaho akbar w saalato wssallamo ala rasoolullAllah

13) Now start your first chakkar (round) of tawaf. Read subhanAllah + Allaho akbar + durood + dua in whatever language.

14) Before reaching Hajr-e-Aswad there is a corner of Kaaba called Rukun-e-Yamani. If possible touch it else move forward to Hajr-e-Aswad and read Rabanna aatina dua.

15) Now start your 2nd chakkar (round) for tawaf from Hajr-e-Aswad in the same way as from step 13 after doing istilaam.
At Rukun-e-Yamani if possible touch it else move forward to Hajr-e-Aswad and read Rabanna aatina dua.

16) Continue from point 15 for all remaining steps. After completing seventh step go to Makaam-e-Ibrahim.
Offer 2 rakaat Namaz-e-Tawaf (Mendatory) if not makrooh time.
In first rakaat read Soorah-Al-Kaafiroon (qul ya aiyuhal kaafiroon), in second rakaat read Sorrah-Ahad (qul huwaLlaho ahad) then do dua.

17) Now go to Multazim. Place between Hajr-e-Aswad and Baab-e-Kaaba. Read dua and ask whatevar you want in your language from Allah.

18) Now go to ZamZam water. Drink as much and then do dua.

19) Now do istilaam for saee. Read Saee ayat while going for saee to Safaa and Marwa. After reaching Safaa, face towards Kaaba, read dua, then do saee niyat.
Now starts going towards Marwa for first saee chakkar (round).

20) While going to Marwa there is an area called Sabz-Mailain marked by green lights. For men walk fast like run a bit as to follow the Sunnat of Bibi Hajira.

21) After reaching Marwa your first step is complete. Now face towards Kaaba read dua then starts walk towards Safaa.

23) After reaching Safaa your 2nd step is compete. Now to Marwa will be third and so on. Complete your all seven steps. Your last seventh chakkar (round) will be at Mawra.

24) Now offer 2 rakaat Namaz-e-Saee. Not a mendatory part but sunnat.

25) Now go for Qasar(trimming hairs) or Halaq(have razor/shave head). Halaq is afzal then Qasar.

26) Now your Umrah is complete maashaAllah. Restrictions and precautions which was while in ahraam is ended now.


Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah
Umrah



Mon

26

Dec

2011

Mon-26-12-2011
   

Installing XP on computer with SATA hard drive



 

Installing XP on computer with SATA hard drive

I recently come across with a problem downgrading a computer comes with Windows 7 to Windows XP, but during setup following error appears telling about Virus or Checkdisk /F bla bla bla,

 

***STOP: 0x0000007B (0xf78d2524, 0xc0000034, 0x00000000, 0x00000000)

 

Dont' worry, give following a try, might be it will work for you aswell,

 

Go to Computer BIOS by pressing F2 or F10 or Del depending on your computer

Go to Storage Option / Drive Configuration

Search for option saying SATA Emulation and change this to IDE from AHCI.

Accept / Save your setting by pressing F10 or Save and Exit

Run Windows XP Setup again

 

Hope it will work 

 


Tue

13

Sep

2011

Tue-13-09-2011
   

SubHumanity



SubHumanity…

R.I.P. the 2,976 innocent Americans who lost their lives on 9/11;

and

R.I.P. the 37,000 Pakistanis, 48,644 Afghans and 1,690,903 Iraqis who paid the ultimate price for a crime they did not commit….


Sun

30

May

2010

Thu-28-07-2011
   

Update Statistics - Query to find tables and index number of statistics being old



Query to find all the Tables and Index with number of days statistics being old. Then run Update Statistics command to update statictics for optimized query plan.

SELECT
OBJECT_NAME(A.object_id) AS Object_Name,
A.name AS index_name,
STATS_DATE(A.OBJECT_ID, index_id) AS StatsUpdated ,
DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),
getdate()) DaysOld
FROM sys.indexes A
INNER JOIN sys.tables B ON A.object_id = B.object_id
WHERE A.name IS NOT NULL
ORDER BY DATEDIFF(d,STATS_DATE(A.OBJECT_ID, index_id),getdate()) DESC

 


Tue

8

Sep

2009

Wed-27-07-2011
   

Poetry - Shairi - Quotes - English - Urdu - Arabic (occasional updation)



I'm hating you. It's all washed out of me. I hate people hard, because an intellectual hate is the worst"
01:32 28-Jul-11


~~~A Taste of Rumi (1)~~~
"When you do things from your soul, you feel a river moving in you, a joy.
When actions come from another section, the feeling disappears. 
Do not be satisfied with the stories that come before you. Unfold your own myth.
Reach for the rope of God. And what is that? Putting aside self-will."
~Rumi~
27-Jul-11


~~~A Taste of Rumi (2)~~~
Don't let others lead you. They may be blind or, worse, vultures.
Now see the invisible. If you could leave your selfishness, you would see how you've been torturing your soul. 
How could we know what an open field of sunlight is? Don't insist on going where you think you want to go. 
Ask the way to the spring. Your living pieces will form a harmony."
~Rumi~
27-Jul-11


Agar mughay pana hay to mugh may utar kar dekh
kinaray say samandar k raaz janay nahi jatay...
16-09-2010


"When I am with you, we stay up all night.
When you're not here, I can't go to sleep.
Praise God for those two insomnias!
And the difference between them.(Rumi)
15-May-2010


The harvest of my pain was its own peace and remedy (Rumi)
14-May-2010


somebody play for live, somebody live for play...
12-Sep-2009


hay shouq-e-safar aisa aik umer say yara 
Manzil bhi nahi pai, rasta bhi nahi badla...
07-Sep-2009


If you dont LOVE me so please HATE me but dont AVOID me!!
22-Jul-2009


I am not a quitter. I make my every failure bare witness of my following truimph...
13-Jul-2009


"How could you reach the pearl by only looking at the sea? If you seek the pearl, be a diver: the diver needs several qualities: he must trust his rope and his life to the Friend's hand, he must stop breathing, and he must jump." 
~ Jalaluddin Rumi
12-Jun-2009


Suffering is a gift. In it is hidden mercy.
~ Jalaluddin Roomi
11-Jun-2009


Categories : Thoughts / Lessons


Fri

15

Jul

2011

Fri-15-07-2011
   

Allahu Rabbuna



bismiLlahir Rehmaanir Raheem

you can download following

Allahu Rabbuna.flv


listen by clicking on following video play button :-

lets remember Allah, These are Allah's beautiful names

Allah.jpg





Intro

Faisal Bashir
Consultant / Software Architect
KalSoft Limited
Microsoft Certified Technology Specialist.
Currently in Dubai. [more]

Right Now

How could u reach the pearl by only looking at the sea? if u seek the pearl, be a diver: the diver needs several qualities, he must trust his rope and his life to the Friend's hand, he must stop breating and he must jump - Jalaluddin Rumi.

Random Visuals

No Excuse image012
No Excuse image012

Show Next Visual

Currently Being Viewed

Recent Comments

Comment RSS

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

By the Fig and the Olive, And Mount Sinai, And this city of Security. Undoubtedly, We created man in the fairest stature. (Holy Quraan - At Teen 95-1to4)
123050 hits. (Best viewed @ 1024x768 resolution min.) Comments here...
© 2001-2012 Muhammad Faisal | Disclaimer | Contact | Partner Site