Thursday, August 13, 2009

Multiple Update in SQL 2008

Problem:
1) Table AAA with null ID and other info
2) Table BBB with ID and other info
3) get the matching data with ID from table BBB to AAA

Solution
1) SQL cursor approch -- I'd avoid
2) SQL Temp table approch -- good & quick

Here is the SQL script for (2) approch:

(1)
create table #tempdata (
firstname varchar(50),
lastname varchar(50),
dob datetime,
id uniqueidentifier
)

insert into #tempdata
select b.FirstName,b.LastName,b.BirthDate, b.id
from
AAA a,BBB b
where
a.FirstName = b.FirstName
and a.LastName = b.LastName
and a.DOB = b.birthDate

select * from #tempdata

--update statement

update AAA
set id = #tempdata.id from #tempdata where
AAA.FirstName = #tempdata.FirstName
and AAA.LastName = #tempdata.LastName
and AAA.DOB = #tempdata.dob


enjoy

Wednesday, August 12, 2009

Monday, August 10, 2009

Thursday, July 30, 2009

Believe in your self

People become really quite remarkable when they start thinking that they can do things.
When they believe in themselves, they have the first secret of success.

Tuesday, July 28, 2009

do right

1) Always do right. This will gratify some people and astonish the rest. -- Mark Twain

Saturday, February 21, 2009

AJAX -- AutoCompleteExtender

Now a days, when you search something on web, Once you type some thing in to search Textbox, The box come up with suggestion starting with that letter.

Here is the pretty good example:


When I typed the "abc" google started to give me suggestions. Its Looks good :-)

The same thing you can achieve in you web application using "AutoCompleteExtender" control.

Let me show you some example:
I wanted to display three more letter as a postfix whatever i am typing...

eg.. prashaXBZ // here laxt there XBZ is my suggestion
For that I will create one web method & it will give me random character.

//web method code




-----------------------------------------------------------------------------
Here is the my .aspx page code



-------------
HERE
MinimumPrefixLength="3" --> it will give you suggestion after three character.
CompletionSetCount="10" --> Number of suggestion you want to see
ServicePath="AutoComplete.asmx" --> My Service virtual path
ServiceMethod="GetCompletionList" --> My service method.
There we go...

ASP.NET Ajax ToolKit

Last week I got little time to explore new stuff in AJAX took kit.
Here is the step how to get AJAX toolkit controls in your web site.

1) Create Sample websit (in 3.5)
2) Get the "AjaxControlToolkit.dll" from the following links
http://www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?
ReleaseId=16488
3) Right click on "Toolbox" of your website and select "Add Tab" & give the tab name
"Ajax Controls Toolkit".
4) Right click and select "Choose Item..." and browse the above .dll
5) There we go... you will get all the Microsoft Ajax Extention controls under
the "Ajax Controls Toolkit" tab.