Tuesday, May 17, 2011

Is not a Microsoft .NET module While Adding AjaxControl Toolkit

I was trying to add Ajax control toolkit to my ToolBox in VS2008 and was not able to do that.
This post finally helped me out.I had to Turn my Mccafee OFF.
http://forums.asp.net/p/1598878/4061430.aspx

Friday, April 1, 2011

Purchasing a Car in USA

As I speak I am just sharing my experince which might be useful to someone who is coming for the first time and want to purchase a car to carry out his living smoothly:).
I don't deny there are definitely smarter people than me :) but yes this is again MY experience...and can/cannot be used as a guide.Dont fix me up for this writeup...

I assume followng holds true for the newcomer:->
1. Is finanacially not very strong in terms of purchainsg the car(0< car value <6-8 grand maxxx) 2. Looking for a used car (given the budget above) .... A car which should not create a problem of whatsoever sorts & does not reqire service/maintenance...having read this just now someone asked me "Realllyy can you get it" Me=>"offcourse not" Be prepared to exercise your judgement/risk-taking skills here ....as i am sure most of you dont even know what an engine looks like or how many cylinders it carries.

3. Wants the best car of town(wishful thinker like me given the budget).

4.Is not having license of US either.

So here you go:-
1. Look for the used cars in craiglist(by owner/dealer both)...follow your car for some time atleast a week

2. Simultaneously look for the cars value in KellyBlueBook (bheb--site) /.....yeah you got it right its a website.

3. The care which matches the price of KBB & The craiglist posting is the right pricing of the car..

4. Now "the car you want" if you dont know i can helep here....
If you are getting all the cars within your budget in craiglist having very high miles apply this logic.
0-50k--any car is good
50-80k---Nissan Sentra/Hyundai sonata/Ultima(if you get one)/Hyundai Elantra/There might be more to this list but i am hanging on here.
80k and above--->Look for Honda Accord/Civic/CRV or Toyota Camry/Corolla only...
(V6 engine is generally more re-selleable item comapred to V4.
And always go for Automatic transmisson instead of manual transmission..Agar apnai car india waaley ghar lekar nahin jaani hai)

5. Once you have zeroed on your car ask for its VIN number from the owner or dealer and look for its CARFAX report (Voilaa what is carfax??)....Carfax (portal) stores all the history of vehicles(if reported)....
Mainly check for salvation/damage/accidents/restored run through Carfax on this Vin Number and if report looks good (before you say its good scan for all possible mysterious and horrifying words of Angrezi/english which can happen to a car like accident...you must have learnt this word by now and damage etc.. etc...)then you are good too....

6. If possible look out for a mechanic nearby your place..who can do a mechanic check of the car (for some dollars offcourse there is nothing like free lunch here my dear friend :)..

7. After you are done with Carfax check and (if possible) mechanic check
you can go for this car....and can purchase it....

Dont review this document please :) I was just feeling bored while working so though of writing this quickly in half an hour......

Thanks for reading..
Enjoy your ride...

Useful Link for Checking Car Emission History (AZ)
http://www.myazcar.com/
http://65.82.88.75/myazcar/histinq.exe/muinput

Nvarchar VS Nvarchar(n) in T-SQL

Recently i encountered a problem which was weired in nature...but yes not very obvious one..took some time to figure out posting here for benefit of other netizens...

Can you spot out the difference between two statments below if yes you are way smarter than me and please log off.....else please continue reading :)

STATEMENT 1:-
***********************************************************************
select EmployeeLookupID from PerformanceReview..EmployeeLookup ELookup
where(
(ELookup.ManagerEmployeeId=N'manager')
OR (ELookup.OneUpManagerEmployeeId=N'manager')
OR (ELookup.EmployeeLookupId=4)
OR (ELookup.ZoneLookupId in
(Select Zlookup.ZoneLookupId from PerformanceReview..ZoneLookup
AS Zlookup where Zlookup.ZoneHRManagerEmployeeId= N'manager')
)
)
Ouput based on my DB records was TWO only and this is what i expected
4
6


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

STATEMENT 2:-
*************************************************************************
declare @EmployeeLookupID int
declare @EmployeeID nvarchar
set @EmployeeLookupID =4
set @EmployeeID =N'manager'
select EmployeeLookupID from PerformanceReview..EmployeeLookup ELookup
where(
(ELookup.ManagerEmployeeId=@EmployeeID)
OR (ELookup.OneUpManagerEmployeeId=@EmployeeID)
OR (ELookup.EmployeeLookupId=@EmployeeLookupID)
OR (ELookup.ZoneLookupId in
(Select Zlookup.ZoneLookupId from PerformanceReview..ZoneLookup
AS Zlookup where Zlookup.ZoneHRManagerEmployeeId= @EmployeeID)
)
)
Ouput based on my DB records was one only and this is what i NOT EXPECTED :(
4

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

the difference between the mismatch of expecattions is
if you have noticed the variable to which i am assinging value is nvarchar & this column(ManagerEmployeeId & OneUpManagerEmployeeId & ZoneHRManagerEmployeeId) is nvarchar(100) and there was some implicit casting going on......behind the scenes :(
so I modified my statmenet 2 to below
MODIFIED STATEMENT 2:-
*************************************************************************
declare @EmployeeLookupID int
declare @EmployeeID nvarchar(100)
set @EmployeeLookupID =4
set @EmployeeID =N'manager'
select EmployeeLookupID from PerformanceReview..EmployeeLookup ELookup
where(
(ELookup.ManagerEmployeeId=@EmployeeID)
OR (ELookup.OneUpManagerEmployeeId=@EmployeeID)
OR (ELookup.EmployeeLookupId=@EmployeeLookupID)
OR (ELookup.ZoneLookupId in
(Select Zlookup.ZoneLookupId from PerformanceReview..ZoneLookup
AS Zlookup where Zlookup.ZoneHRManagerEmployeeId= @EmployeeID)
)
)
Ouput based on my DB records was one only and this is what i NOT EXPECTED :(
4

*************************************************************************
and it returned me two rows as i expected...always look up to what is the column datatype and use the variable in your stored procedure also of that data type is what i learnt ......

still trying to figure out why Nvarchar is different than nvarchar(100) in above case...

Take care till than bbye

Wednesday, November 11, 2009

Why do we need [Flags]

Found it quiet not quite:) interesting so here i go
System.FlagsAttribute

[Flags]
enum StateWithFlags
{
None = 0,
Read = 1,
Write = 2,
Delete = 4
}

enum StateWithNoFlags
{
None = 0,
Read = 1,
Write = 2,
Delete = 4
}

for (int enumValue = 0; enumValue <= 8; enumValue++)
Console.WriteLine("StateWithFlags: " + enumValue.ToString() + " " + ((StateWithFlags)enumValue).ToString());
/*
this returns:(2=1 in case of 3 as 3 is not defined similarly for 5=4+1)
StateWithFlags: 0 None
StateWithFlags: 1 Read
StateWithFlags: 2 Write
StateWithFlags: 3 Read, Write
StateWithFlags: 4 Delete
StateWithFlags: 5 Read, Delete
StateWithFlags: 6 Write, Delete
StateWithFlags: 7 Read, Write, Delete
StateWithFlags: 8 8
*/


for (int enumValue = 0; enumValue <= 4; enumValue++)
Console.WriteLine("StateWithNoFlags: " + enumValue.ToString() + " " + ((StateWithNoFlags)enumValue).ToString());
/*
this returns:
0 None
1 Read
2 Write
3 3
4 Delete
*/

Hope this is self explanatory :)

Thursday, October 29, 2009

RS 6230 for Who you are

Sum that people pay at times to discuss bullshit....

"Kya hai" "Kyun hai" "Main kaun hoon" "Kyun Hoon" Sounds Like Chuck this guy out...He is asa/ramdev extra types that are seen on pragya tv....

A simple question i am trying to evaluate from past (after 8th standard there is a long story behind this period you would need to be 8 10 pegs down with me before i start this chapter enough...focus after closing bracket now) 14 years ....didnt get an answer though. Does anyone has that answer go ahead and i ask you yes you to provide me and help me in every possible way you can (your motive could be being a human being)all answers will lead me to somewhere.......

An incident today :-So there was a small discussion within a group of intellectually percepted and knowledgeably masturbated(original term is intellectual masturbation hats off) people and the crux is no one is sure what it is why it is types but yes i am sure thats an intriguing question which everyone must evaluate and try to answer.It will surely help him(I am a male chauvinist) in leading his life in a meaningful manner....
I don't want to say-utter what i have percepted or learned (a relatively permanent change in behavior is learning) so far....
Just a thought may be but i assume its intriguing for sure i am still struggling...

Tuesday, October 27, 2009

How to insert ' character in sql server

Heard Many done Many times but couldn't find a better google link
so posting it here for my own use or someone elses may be :)

Had a requirement to insert special characters ' in nvarchar
Now the data to be inserted is
Integrated Security=SSPI;Pooling='true';Persist Security Info=False;Initial Catalog=xyz;Data Source=LocalHost;Min Pool Size=5

we have a table whose value coulmn(Value column is of nvarchar(1024) type) needs to be inserted with this data(note the data to be inserted carries a 'true' value also)
so the trick is here-

update mytable set
value= 'Integrated Security=SSPI;Pooling=''true'';Persist Security Info=False;Initial Catalog=sleepme;Data Source=LocalHost;Min Pool Size=5' where idname='DataLocation'

Relief....

Wednesday, October 14, 2009

To Rohit student of IIIrd B

This is something coming straight from my heart...
I got a card today from Rohit a student of IIIrd -B Quoting "To Mr.Sandeep Lohani"
With a message "Help is always considered in the eyes of GOD. Thanks! From, Rohit"
To tel you some features of this card..
1. Amazing Clean and Neat Hand Writing...
2. Flawless Drawing of a beautiful Rose in the front(Created by Cute Rohit)
3. The Message....

Now you must be wondering why i got this card ...
Reason:In his eyes i made a difference to his life by contributing a meagre amount to his education.....which was not a significant amount from my end at all....
filled with emotions and Abbot to cry is what i feel right nowow..

Guys Trust me go ahead and make a difference to the life's of these children and trust me again end of the day it would be worth seeing the growth of these wonderful brilliant kids....
Go ahead and make a difference to someones life and this would be worth it....