Sunday, June 14, 2009

How to make money by your website? Part -I

Hello

"Money" wao after having this everything is going smooth in life but the thing is how to make money.

yup this is the bigger question after doing a lot of hard work but still we getting same amount. so here i am for giving you some extra tips how to make some money.

Actaually internet gives us lots of ways to make money in that ways i will mention here some of the links which is useful and helpfull in revenue genrate.

so my first link is

1) www.rentAcoder.com :-
The Rent A coder is the site which provide you a way to grabe online project and you don't have time to work on project then you can just use affilation programs by which you can also or make money.

for more help click below image



2) www.GetAcoder.com :-
My another link is www.GetAcoder.com
From this site also you can earn money by grab projects do online project. and same if you don't want to work on projects then just use affilation programs by which you can also earn money.

for more help click on below image
Get custom programming done at GetACoder.com!

3) www.getAFreeLancer.com
Another most popular link in www.getAFreeLancer.com
On this web site you can get lots of project in diffrent language.
but if you don't have money and wana earn money then just use affilation programs.
for more information just click the below image.
Freelance Jobs

I will provide many more useful sites in next post.

Thanks & Regards
Rajat Jaiswal

Sunday, June 07, 2009

How to add AJAX tab control at run time?

Hello friends,
Today we will discuss how to add Ajax tab control at run time.

As you know for adding tab control in our page we require two Ajax controls one is AJAX Tab Container and second is AJAX tab Panel control.
AJAX tab container is main control and Tab Panel is child control. Now you have to follow step as follow.

Step 1:-
For this first just drag drop a Tab Container on our aspx page.

Step 2 :- Now you have to add panel in tab container for that we have to work in special method of tab Container which is tab Initialize method.
It means you have to work in below event.
Private Sub tabCont_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles tabCont.Init
Try
Me.pvt_DefineTabControl()
Catch ex As Exception
Throw ex
End Try
End Sub
Here I have created a Define tab control method in which we define tab control at run time.
According to my knowledge if you do not use this tab initialize method than you can not use run time control creation. So this event is must when you creating run time tab control

Step3 :- you are thinking what is pvt_DefineTabControl method so it’s a simple work as you see below.
Private Sub pvt_DefineTabControl()
Try
If Me.tabCont.Tabs.Count > 0 Then
Me.tabCont.Tabs.Clear()
End If
If Session("Counter") Is Nothing OrElse Trim(Session("Counter")) = String.Empty Then
Session("Counter") = 1
End If
For intI As Integer = 0 To CInt(Session("counter")) - 1
Dim tabPan As New TabPanel
Dim btnPanelNumber As New Button
btnPanelNumber.ID = "btnPanel" & intI.ToString
btnPanelNumber.Text = "Click me to create Panel " & (intI + 1).ToString
AddHandler btnPanelNumber.Click, AddressOf MyButtonClick
tabPan.Controls.Add(btnPanelNumber)
tabPan.HeaderText = "Panel" & intI.ToString
Me.tabCont.Controls.Add(tabPan)
Next
Catch ex As Exception
Throw ex
End Try
End Sub
Step 4: here I have added one Button in Tab Panel for this I used a common Click event handler which is MyButtonClick
By default there is a single TabPanel when you click button in tab Panel then you will get next panel.
Private Sub MyButtonClick(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Session("Counter") = Session("Counter") + 1
Dim strButtonId As String = CType(sender, Button).ID
Dim intId As Integer = CInt(strButtonId.Replace("btnPanel", 0))
Me.pvt_DefineTabControl()
Me.tabCont.Tabs(intId).HeaderText = "You have Clicked me" + intId.ToString + "Panel's Button"
Catch ex As Exception
Throw ex
End Try
End Sub

Step 5:- For Example you can visit on http://indiadotnetajaxtabwork.tk/

and download code also.

Thanks & Regards
Rajat
Enjoy Coding :)
Enjoy Ajax tool kit :)

for more information http://www.indiandotnet.wordpress.com

How to import CSV in dotnet or direct Sql Server in 5 minutes?

Hello Friends,
Many times we require a logic by which we can import a csv file in grid or database.So don't worry its not a big issue now For this I am taking below example this example is in VB.net (windows application)
Suppose I have csv file with following values
"ADDRESSID,ACCOUNTNO,ADDRESSTYPE,CODE,NAME,COMPANYNAME,ADDR1,ADDR2,ADDR3,
ADDR4,CITY,STATE,PROVINCE,ZIPCODE,POSTALCODE,COUNTRY,PHONENO,
EXTENSION,NOTIFICATIONEMAIL"
Or we can say above is the column name in this order the csv file is arrange.
So first what we do we just read the file for this
Me.OpenFileDialog1.Multiselect = False
Me.OpenFileDialog1.ShowDialog()
Me.txtPath.Text = Me.OpenFileDialog1.FileName
Dim sReader As New StreamReader(Me.txtPath.Text)
Dim strFile As String = sReader.ReadToEnd
sReader.Close()

Now in next step what we do we create a table with column which are exist in csv file remember we have to use same order for this we will write following code
Dim tbl As New DataTable
tbl.Columns.Add(New DataColumn("ADDRESSID"))
tbl.Columns.Add(New DataColumn("ACOUNTNO"))
tbl.Columns.Add(New DataColumn("ADDRESSTYPE"))
tbl.Columns.Add(New DataColumn("CODE"))
tbl.Columns.Add(New DataColumn("NAME"))
tbl.Columns.Add(New DataColumn("COMPANYNAME"))
tbl.Columns.Add(New DataColumn("ADDR1"))
tbl.Columns.Add(New DataColumn("ADDR2"))
tbl.Columns.Add(New DataColumn("ADDR3"))
tbl.Columns.Add(New DataColumn("ADDR4"))
tbl.Columns.Add(New DataColumn("CITY"))
tbl.Columns.Add(New DataColumn("STATE"))
tbl.Columns.Add(New DataColumn("PROVINCE"))
tbl.Columns.Add(New DataColumn("ZIPCODE"))
tbl.Columns.Add(New DataColumn("POSTALCODE"))
tbl.Columns.Add(New DataColumn("COUNTRY"))
tbl.Columns.Add(New DataColumn("PHONENO"))
tbl.Columns.Add(New DataColumn("EXTENSION"))
tbl.Columns.Add(New DataColumn("NOTIFICATIONEMAIL"))

One this done then what we do we read all the rows one by one and split it with comma seprated value and create row in our table.
Dim strReadLine() As String = Split(strFile, vbCrLf)
The above line just convert single line in multiline with delimiter Vbcrlf which means Line break
One this done then we have collection of individual row in same format in our variable strReadLine
Now we read each line from strReadLine and create new row in table column
For intCount As Integer = 1 To strReadLine.Length - 1
Dim strColumn() As String = strReadLine(intCount).Split(",")
Dim DataRow As DataRow = tbl.Rows.Add()
For intCol As Integer = 0 To strColumn.Length - 1
DataRow(intCol) = strColumn(intCol)
Next
Next
Me.dgv.DataSource = tbl

So in this way we import a csv file and bind that files value in a dataGrid.

Friends if you don't want to use vb.net and want directly import csv file in SQL Server then SQL Server support a unique sql command which is Bulk Copy
Suppose the file we have to import directly in a table which having this column then we have to write follow lines

BULK
INSERT tblImportTest
FROM 'c:\rajat.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO

So I think friends the above code solve our problems in many ways hope you like article.
You can download code from http://www.indiandotnet.tk

Thanks
Enjoy codeing, Enjoy dot net :D
Rajat

5 Ways in 5 minutes to find 2nd highest Salary Or 2nd minimum Salary

Hello friends,

Today's post is for all new bibes going for interview and scarred of sql query question how to determine 2nd highest or 2 nd lowest salary.

Or we can say nth highest or lowest salary for this I will provide you some basic Sql suppose.

DECLARE @tblEmployeeSalary TABLE(lngEmployeeId INT, strEmpName VARCHAR(100), fltBasicSalary FLOAT)

INSERT @tblEmployeeSalary SELECT 1,'RAJAT',345345

INSERT @tblEmployeeSalary SELECT 2,'ASHISH',76845

INSERT @tblEmployeeSalary SELECT 3,'KAPIL',234545

INSERT @tblEmployeeSalary SELECT 4,'KAMLESH',74564

INSERT @tblEmployeeSalary SELECT 5,'RAVI',56756456

INSERT @tblEmployeeSalary SELECT 6,'SHIV',75675

INSERT @tblEmployeeSalary SELECT 7,'MONICA',76566

INSERT @tblEmployeeSalary SELECT 8,'PIYUSH',58776

INSERT @tblEmployeeSalary SELECT 9,'KUNAL',345567

INSERT @tblEmployeeSalary SELECT 10,'MANISH',76766

1) The below query is simplest query for finding 2nd minimum salary.if you want 2nd maximum salary then

you have to just change the order by fltbasicSalary desc.

SELECT MAX (fltBasicSalary)

FROM @tblEmployeeSalary

WHERE fltBasicSalary IN (SELECT DISTINCT TOP 2 fltBasicSalary

FROM @tblEmployeeSalary

ORDER BY fltBasicSalary ASC)

2) This bit complex then first one in that you have to change condition of where clause for min /max

according to your requirment. if you want nth highest or lowest salary then just replace 2 by

that particular number which you want.

SELECT MIN(fltBasicSalary)

FROM @tblEmployeeSalary e1

WHERE 2 <=(SELECT COUNT(*)

FROM @tblEmployeeSalary e2 WHERE e1.fltBasicSalary >= e2.fltBasicSalary);

3) This is simple one but restriction is it require SQL SERVER 2005 it will not work on SQL server 2000

actually in sqlserver 2005 we have Rank, Row_Number(), Dens_Rank() function by utilizing then we can ,

give a row rank or number. i am using that concept.



SELECT tmp.fltBasicSalary

FROM (SELECT DISTINCT fltBasicSalary ,

ROW_NUMBER()OVER (ORDER BY fltBasicSalary ASC) As intRowNumber

FROM @tblEmployeeSalary)tmp

WHERE tmp.intRowNumber = 2

4) In same way we can use Rank and dens rank

SELECT tmp.fltBasicSalary

FROM (SELECT DISTINCT fltBasicSalary ,

RANK()OVER (ORDER BY fltBasicSalary ASC) As intRowNumber

FROM @tblEmployeeSalary)tmp

WHERE tmp.intRowNumber = 2

5) This is another way of getting max or min salary by a group by statement

SELECT TOP 1 fltBasicSalary

FROM (SELECT TOP 2 fltBasicSalary

FROM @tblEmployeeSalary

GROUP BY fltBasicSalary ORDER BY fltBasicSalary ASC) AS tmp ORDER BY fltBasicSalary DESC

I hope you people like it.

if you find any problem in that feel free to ask...

enjoy SQL server.

enjoy programming

Thanks

Rajat

for more information checkout http://www.indiandotnet.wordpress.com

Simplest Chat Application in 5 minutes

Hello friends,
Yesterday night just wondering on net, I just found a interesting control which is JAXTER Chat Control.
So I just went on the site and download trial version from site URL.

http://www.webfurbish.com/

I really like this control it’s easy to use with your asp.net code.
It provides many themes you can use and one of them.

I really like what ever it does. It’s really good control.

Just visit below link for enjoying the control.

http://indiandotnetnewchat.tk/

And if you like these controls then buy from site
http://www.webfurbish.com/

ThanksEnjoy coding , enjoy new things.

Rajat Jaiswal
for more information you can use http://indiandotnet.wordpress.com

SQL Server Performance Improvement

Hello Friends,

First of all really sorry that you have to wait for 2 weeks for my new article actually i stuck in some real problem in my office project and that is Performance improvement of a store procedure, & that's why our current topic is "SQL Server Performance Improvement"

Here are some important point which i find and used to improve performance of my store procedure i hope this will help you to.

1) Try to use where clause for restrict result.

2)Use predecessor "dbo." for tables.

3)Use proper join ("INNER JOIN ,OUTER JOIN ")

4) Try to avoid "OR" condition use "UNION" over there.

5) Try to avoid "IN" Operation .

6) Try To avoid "NOT IN" operation

7) Try to avoid "DISTINCT".

8) Try to avoid "CROSS JOIN".

9) Try to avoid use of Temporary Table. but if needed then define pre structure for that.

9) Define PRIMARY Key & UNIQUE Key Constraint for each table.

10) Try to avoid "HAVING Clause"

11)Include "SET NOCOUNT" at the first of your store Procedure.

12) Try to avoid "CURSOR".

13) Use "UNION ALL" Instead Of "UNION".

14) Try to create INDEX.

15) Create Index On column which is frequently used in Where , order by & Join.

16) Try to create index on Integer Column.

17) try to avoid "SELECT * " instead of it use "SELECT columnname,"

18) Use Sp_ExecuteSQL instead of EXECUTE

19)Use Explicity Index "With( INDEX( INDEXNAME)) with table.

20) Maximize the thread.

The above 20 points i used and my store procedure is fast.

if you people try to use above 20 points then it will benifitial to you also.

Rest if you need any kind of help of me and my SQL Expert friends then you can just put comment.

Thanks & enjoy SQL Server

Your Host & friends

Rajat :)

For more information you can try http://www.indiandotnet.wordpress.com also.