ASP.net day

This is ASP.net tips and triks by Satalaj More and community contrubition

MS Sql Random select

clock July 3, 2009 00:09 by author Satalaj

 If you want to select Random top 10 rows from MS sql table then use NEWID().
For e.g.
 
   select top 10 * from xyzTable order by NewID()

This statement will give always random top 10 rows from data table.

*Note it's performance is slow if table size is high.
Any other alternative or trick guys ?

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Reportviewer and Temp Variables

clock June 29, 2009 00:25 by author Satalaj

  While working with report viewer and Stored procedures which uses temporary variables
you might have got the problem of not getting schema in dataset. To resolve this issue use Table variables to return table instead of returning usine table varaibles
like select * from #temp

e.g of Table variable

Declare @x Table (ID bigint identity(1,1), Name varchar(50))

Insert into @x (Name) values('Satalaj More')

Select * from @x

********************

Table variables work similar to temporory variables you can get more details about temporory variable and

table variable at here http://www.codeproject.com/KB/database/SQP_performance.aspx

-Satalaj

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Windows Mobile 6.0 Deep Dive

clock June 25, 2009 19:17 by author Satalaj

  Last monday 22/06/2009 we the ASP.net team underwent through Windows mobile training session held at new Delhi.
 It was great with Mr. Amol Vaidhya training instructor.

Some cool features we had learned from these sessions are.

1. Global positioning system. GPS.
2. ActiveSync.
3. Performance optimisation and best practices.

  GPS programming using windows mobile SDK 6.0 and Microsoft visual studio 2008  is awasome.
Here you don;t need to write lines of code to get the Longitude latitude and other stuff.
Just instantiate an object of GPS and call the methods in it. 

 One can integrate this GPS functionality with direct GPS signalas coming from satellite or GPS Signals coming from your SIM Service providers.

   Also to send SMS you donl;t need to write bunch of code. Its too simple like creating an object and pass the parameters like mobile number and message.
The emulators shown during the labe which simulates the real scenario are fentastic. you can find the fake GPS utility in your windows 6.0 SDK tools.
http://msdn.microsoft.com/en-us/library/bb158722.aspx .

-Satalaj.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Google applications single sign on

clock June 16, 2009 22:36 by author Satalaj


Have you noticed this stuff  using google applications like www.orkut.com , www.google.com , www.gmail.com , www.google.com/analytics
 
e.g. using IE 6

1. open www.orkut.com login to it

2. open new tab open www.google.com you will see your signed in status at top right corner.

3. Click log out from www.google.com, you will get loged out

4. try to access the links inside www.orkut.com you will be redirected to login

5. go back to google.

6. Login to google Notice once you loged in to google obeserve orkut signin page is automatically redirecting you to authorised zone.

I think it can be done using cookies where you should continuosely check wheather cookie is expired / not based on that do
auto login logout.

anybuddy has any idea how they are doing ? or any other way to acheve it ?

ASP.net single sign on triks and tips can be found at http://blogs.neudesic.com/blogs/michael_morozov/archive/2006/03/17/72.aspx

-Satalaj

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About Satalaj More


R&D, Re-engineer, rewrite or extend existing systems.




RecentPosts

RecentPosts

Calendar

<<  July 2009  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Sign in