When we import Excel data into SQL table it will create columns with 'Float' data type.
Here is the little trikey to convert float value to varchar/nvarchar
select top 1 convert(varchar,cast(floatNumber as decimal)) n from dbo.Mytable
Wednesday, December 16, 2009
Saturday, December 12, 2009
hardest interview question job site
1 Hardest Job Interview Question
http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&discussionID=10692981&gid=40717&trk=EML_anet_qa_ttle-cDhOon0JumNFomgJt7dBpSBA
Top 100 Niche Job Sites
http://newgradlife.blogspot.com/2009/12/top-100-niche-job-sites.html
http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&discussionID=10692981&gid=40717&trk=EML_anet_qa_ttle-cDhOon0JumNFomgJt7dBpSBA
Top 100 Niche Job Sites
http://newgradlife.blogspot.com/2009/12/top-100-niche-job-sites.html
sql server with TB how to manage data
good article, worth to read when you have large amount of data (TB)
http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&discussionID=10740201&gid=59185&trk=EML_anet_qa_ttle-cDhOon0JumNFomgJt7dBpSBAjavascript:void(0)
http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&discussionID=10740201&gid=59185&trk=EML_anet_qa_ttle-cDhOon0JumNFomgJt7dBpSBAjavascript:void(0)
Using Timer in Windows Services
http://www.developer.com/net/net/article.php/3335731/Using-Timers-in-a-Windows-Service.htm
Using Google Map API in your Web application
http://aspsnippets.com/post/2009/04/15/Using-Google-Maps-API-in-ASPNet.aspx
Friday, November 27, 2009
Tuesday, November 10, 2009
Dell Inspiron 1525 lock with 9
Press Fn + Power key & see the below chart
--Here is the chart
http://support.dell.com/support/topics/global.aspx/support/dsn/en/document?c=us&cs=19&dl=false&l=en&s=dhs&docid=DBECF64CFEDA449398CB9E859D4944A5&doclang=en
--Here is the chart
http://support.dell.com/support/topics/global.aspx/support/dsn/en/document?c=us&cs=19&dl=false&l=en&s=dhs&docid=DBECF64CFEDA449398CB9E859D4944A5&doclang=en
Wednesday, November 4, 2009
asyncronyes method invocation
http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspx
http://www.codeproject.com/KB/cs/AsyncMethodInvocation.aspx
http://www.codeproject.com/KB/cs/AsyncMethodInvocation.aspx
Labels:
C#
Tuesday, November 3, 2009
best time to buy car
http://blogs.consumerreports.org/cars/2007/08/car-buying.html
Friday, October 30, 2009
Good books
Good book, if you have tiem to read
http://business.rediff.com/special/2009/oct/30/five-great-business-books-to-read.htm
http://business.rediff.com/special/2009/oct/30/five-great-business-books-to-read.htm
Wednesday, October 28, 2009
Friday, October 16, 2009
Find Remove Delete duplicate rows in sql
select MyId,COUNT(1) from #MyTable
group by MyId
having COUNT(1) > 1
--Select duplicate records
with CTE
AS
(SELECT MyId, RANK() OVER (PARTITION BY MyId ORDER BY num) rnk
FROM(SELECT *, ROW_NUMBER() OVER(ORDER BY MyId) num
FROM #MyTable
) X
)
Select * from CTE
WHERE rnk > 1
--Delete Duplicate records
with CTE
AS
(SELECT MyId, RANK() OVER (PARTITION BY MyId ORDER BY num) rnk
FROM(SELECT *, ROW_NUMBER() OVER(ORDER BY MyId) num
FROM #MyTable
) X
)
delete from CTE
WHERE rnk > 1
group by MyId
having COUNT(1) > 1
--Select duplicate records
with CTE
AS
(SELECT MyId, RANK() OVER (PARTITION BY MyId ORDER BY num) rnk
FROM(SELECT *, ROW_NUMBER() OVER(ORDER BY MyId) num
FROM #MyTable
) X
)
Select * from CTE
WHERE rnk > 1
--Delete Duplicate records
with CTE
AS
(SELECT MyId, RANK() OVER (PARTITION BY MyId ORDER BY num) rnk
FROM(SELECT *, ROW_NUMBER() OVER(ORDER BY MyId) num
FROM #MyTable
) X
)
delete from CTE
WHERE rnk > 1
Tuesday, October 6, 2009
good article to study in abrod
http://getahead.rediff.com/report/2009/oct/06/career-study-us-makes-more-sense-today.htm
Thursday, October 1, 2009
World's top 10 mobile - 2009
http://business.rediff.com/slide-show/2009/oct/01/slide-show-1-tech-top-10-mobile-phones.htm
Wednesday, September 30, 2009
Tuesday, September 29, 2009
What is dual listing -- Good article ADR/GDR
http://business.rediff.com/report/2009/sep/29/perfin-what-is-dual-listing-and-why-india-may-not-adopt-it.htm
Sunday, September 27, 2009
look young
Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young. The greatest thing in life is to keep your mind young.
Saturday, September 26, 2009
Silverlight tutorials
http://www.davidezordan.net/blog/?p=1436
http://www.smartwebcontrols.com/video/
http://www.smartwebcontrols.com/video/
Wednesday, September 23, 2009
Simple Recursive example C#
#purpose : method to get the decimal position based on passed number
private static int GetDividebyValue(int dec_position)
{
return ((dec_position == 1) ? 1 : (10 * GetDividebyValue(dec_position - 1)));
}
//calling method
int dividby = GetDividebyValue(decimal_position+1);
private static int GetDividebyValue(int dec_position)
{
return ((dec_position == 1) ? 1 : (10 * GetDividebyValue(dec_position - 1)));
}
//calling method
int dividby = GetDividebyValue(decimal_position+1);
Monday, September 14, 2009
installutil.exe -- exited with code -1
Powershell
if you open the visual studion without Administrator mode you will get
"existed with code -1" error,
open the visual studio as a 'administrator' and run open and compile the powershell project.
happy coding
if you open the visual studion without Administrator mode you will get
"existed with code -1" error,
open the visual studio as a 'administrator' and run open and compile the powershell project.
happy coding
Saturday, September 12, 2009
visual studio add-ins
http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&discussionID=7028171&gid=43315&trk=EML_anet_qa_ttle-cDhOon0JumNFomgJt7dBpSBA
Friday, September 11, 2009
The ' ' character, hexadecimal value 0x20, cannot be included in a name
While creating XElement or XMLElement from C# code,
probably you will get below error
Error:
The ' ' character, hexadecimal value 0x20, cannot be included in a name.
Solution:
XElement/attribute does not contain space between node name, make sure your node name doesn't have white spaces.
for example
<Row Total Cost="" />
change to
<Row TotalCost="" />
if you notice second one there is no white space on Attribute TotalCost
hope this helps
probably you will get below error
Error:
The ' ' character, hexadecimal value 0x20, cannot be included in a name.
Solution:
XElement/attribute does not contain space between node name, make sure your node name doesn't have white spaces.
for example
<Row Total Cost="" />
change to
<Row TotalCost="" />
if you notice second one there is no white space on Attribute TotalCost
hope this helps
Friday, September 4, 2009
Delete Remove duplicate in SQL
1) find duplicate
select name,city,COUNT(1)
from mytable
group by name,city
having COUNT(1) > 1
2) remove duplicate - best way
CREATE TABLE #Table1 (col1 int, col2 int)
INSERT INTO #Table1 VALUES (1, 1000)
INSERT INTO #Table1 VALUES (2, 2000)
INSERT INTO #Table1 VALUES (2, 2000)
INSERT INTO #Table1 VALUES (3, 3000)
INSERT INTO #Table1 VALUES (3, 3000)
INSERT INTO #Table1 VALUES (4, 4000)
SELECT * FROM #Table1;
WITH T1 AS (SELECT (ROW_NUMBER() OVER (PARTITION BY col1 ORDER BY col1)) AS RNum FROM #Table1)
DELETE FROM T1 WHERE RNum IN (SELECT a.RNum FROM T1 AS a, T1 AS b WHERE a.RNum > b.RNum GROUP BY a.RNum)
SELECT * FROM #Table1
DROP TABLE #Table1
3) remove duplicate
SELECT DISTINCT * INTO tab2 FROM tab1 — distinct of all columns
DROP TABLE tab1
EXEC sp_rename ‘tab2′,’tab1′
4) remove duplicate
don't want to tab1
--get distinct duplicate records in #tempTable using option1
--remove all duplicate records from mail table
--insert #tempTable records in to tab1
--drop #tempTable
select name,city,COUNT(1)
from mytable
group by name,city
having COUNT(1) > 1
2) remove duplicate - best way
CREATE TABLE #Table1 (col1 int, col2 int)
INSERT INTO #Table1 VALUES (1, 1000)
INSERT INTO #Table1 VALUES (2, 2000)
INSERT INTO #Table1 VALUES (2, 2000)
INSERT INTO #Table1 VALUES (3, 3000)
INSERT INTO #Table1 VALUES (3, 3000)
INSERT INTO #Table1 VALUES (4, 4000)
SELECT * FROM #Table1;
WITH T1 AS (SELECT (ROW_NUMBER() OVER (PARTITION BY col1 ORDER BY col1)) AS RNum FROM #Table1)
DELETE FROM T1 WHERE RNum IN (SELECT a.RNum FROM T1 AS a, T1 AS b WHERE a.RNum > b.RNum GROUP BY a.RNum)
SELECT * FROM #Table1
DROP TABLE #Table1
3) remove duplicate
SELECT DISTINCT * INTO tab2 FROM tab1 — distinct of all columns
DROP TABLE tab1
EXEC sp_rename ‘tab2′,’tab1′
4) remove duplicate
don't want to tab1
--get distinct duplicate records in #tempTable using option1
--remove all duplicate records from mail table
--insert #tempTable records in to tab1
--drop #tempTable
Tuesday, September 1, 2009
Quote of the day
The indispensable first step to getting the things you want out of life is this: decide what you want.
Saturday, August 22, 2009
top 3 tools beside VS
http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers=&gid=43315&discussionID=6280586&split_page=1
Friday, August 14, 2009
Adomdclient dll
For SQL 2008, you will get ADOMD client installer here...
http://www.microsoft.com/downloads/thankyou.aspx?familyId=228de03f-3b5a-428a-923f-58a033d316e1&displayLang=en
once you install the above installer you will get
Microsoft.AnalysisServices.AdomdClient.dll
at under the below location
C:\Program Files\Microsoft.NET\ADOMD.NET\100
http://www.microsoft.com/downloads/thankyou.aspx?familyId=228de03f-3b5a-428a-923f-58a033d316e1&displayLang=en
once you install the above installer you will get
Microsoft.AnalysisServices.AdomdClient.dll
at under the below location
C:\Program Files\Microsoft.NET\ADOMD.NET\100
Thursday, August 13, 2009
documentation tool for SQL Analysis Services
http://bidocumenter.com/Public/Default.aspx
http://www.ssas-info.com/VidasMatelisBlog/144_using-ssrs-to-report-ssas-2008-database-structure-using-dmvs
http://www.elsasoft.org/download.htm
http://www.ssas-info.com/VidasMatelisBlog/144_using-ssrs-to-report-ssas-2008-database-structure-using-dmvs
http://www.elsasoft.org/download.htm
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
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.
When they believe in themselves, they have the first secret of success.
Tuesday, July 28, 2009
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 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.
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.
Subscribe to:
Posts (Atom)