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.

Sunday, March 01, 2009

Basic of JQuery With Asp.net

1. What is Jquery ?
Answer: Jquery is JavaScript Library whose main moto is to simplifiy the use of java script for a html document.
It is a light weight JavaScript Library that emphasis intraction between JavaScript & Html.
It simplify traversing ,event handling , animation and ajax.

2. How it Works ?
Answer: To Work with Jquery you have to copy the Jquery Js file in your project.
And refrence in your page like <--
script type="text/javascript"
src="jquery.js" --
>
And you can use it. Second point is that you have to start Jquery in $(document).ready event
And all the event will comes under this ready event.
3. Necessary component to work with Asp.net + Jquery?
Answer: For Jquery in Asp.net you need to have to copy two files in your Project and refrence in your project jquery-1.2.6-vsdoc.js & Jquery1.2.6.js
4. Traversing
Ans:
1) you can find particular element in below type
$("#elementId) -- Suppose there a div box with id dvTest <
div id="dvTest"
--> then we have to use $("#dvTest")
$("element"), -- Suppose there div box in page then if we want to change all the div box background color then we can find all the div with $("div")
$("element").eq(index) -- Now if we want to change the background of of first div only then $("div").eq(1) here eq(1) change the background color of index 1 div
$("element").find() -- Search all the element that match with particular expression like $("div").find("p") here we find all the p which are in div tag
$("element").contnent()- it work same as find
$("element").next() - will find next sibling after element.
$("element").nextAll() - wiil find all next sibling after element but not there child element.
$("element").length() - determine number of element in document
$("element").parent.get(0)- will return the parent of element….
$("element").prev ;- get the privious sibling of each of element...
5. Effects :-
Ans:
Jquery makes it easy to show effects now we don't have to write lot of code for some specific animation here are some example.

$("element").toggle(function1,function2) :- By the name its clear that it will toggle the event which we can use in showing different effects.
Ex- if we want to do colour change of div on different click then we do following code
$("#divtest").toggle(function() { $("divtest").css("background-color", "red");}, function ("divtest").css("background-color","blue");});
in the simillar manner we can do different thing also.
$("element").hover(function):- for hover effect.
$("element").FadeIn(intAmount) :- for fade in effect.
$("element").FadeOut(intAmount):- for fade out effect.
$("element").hide(intAmount) :- for hide effect.
$("element").show(intAmount) :- for show effect.
$("element").animate() :- for animation effect we have animate function
for example lets see below example $("#btnFade").click(function() { $("#dvTest").animate({ "left": "+=50px" }, "slow"); });
It will increase left of div test by 50px with slow speed.
$("element").slideToggle() :- it will move up or down according to last action did by element for example.
$("#btnOpen").click(function() {

$("#dvTest").slideToggle('slow', animate());
function animate() {
}
});
The above button click wiill slide up or down with slow speed.
$("element").slideUp(speeed) :- it will slide up the element with desire speed.
$("element").slideDown(speed) :- it will slide down the element with desire speed.
$("element").fadeTo(speed,opacity):- the extra element is opacity means we can define opacity also with speed for particular element fade effect.
$("element").Stop() :- it will stop all the animation running on the element.
7. Events
Ans: Jquery event system is normalize the event object.Then event object is guranteed to be passed in event handler.
Here is more description
1) event.type :- Determine the nature of event.
Ex:- $(a).click(function(event) { alert(event.type);}); it will return "click"
2) event.target:- Give the refrence of DOM element which raised the event.
EX:- $(a).click(function(event){alert(event.target.href);});
Return the url which is assign to a for href property.
3)event.pageX/pageY: - return the mouse position (cordinate) relative to the document.
Ex:- $(a).click(function (event){ alert(event.PageX); alert(event.PageY); });
4) event.preventDefault() :-
it will stop the default exceution action.
EX:- $(a).click(function(event) { event.preventDefault(); alert('test');}); stop the a href ( transfer to another page)
The above are the basic for event object.
5) ready :- On of the most and basic event for Jquery is ready().
It bind the function to be executed when ever the document is ready for traverse and mainupulate.
Its base of jquery it improve web performance as well.
You many have as many as ready event in your web form. It will execute in the order as you define the events. It’s a solid replacment of window.load()
6) Bind() :- Suppose you have more than one paragraph and you want same event on each paragraph then instead of writing each paragraph event.you can bind paragraph with particular event.
Ex:- $("p").bind("onmouseover", function (){ $(this).css("background- color","red");});
7)One() :- suppose we want a event only once on the document then we can bind the event by one.
Then it will run only once on the particular event.
Ex:- suppose we want click event only once on all the div then
$("div").one("click",function() { ($(this).css("background-color", "blue"); });
8) unbind() :- it will just do upposit the bind event.it unbind all the event for match element.
9) blur() :-
trigger blur event on each matched element. Or in other word we can say when focus is lost from the element then this event run.
Ex:- $("txtName").blur(function() { $(this).css("border","2px");});
9) change():- Change event fire when element's value has been modified.
Ex:- $("txtName").change(function() { alert($("txtName").text();});
There are many more events which is as follow click(),
dblClick(),error(),focus(),KeyDown(),KeyPress(), keyUp(),Load(),mouseout(),mouseover(),mouseup(),mousedown(),resize(),Scroll(),
select(),Submit(),unload().
9. Ajax Functionality
Ans:
Jquery is giving many function for using ajax which help to use ajax functionality easy. Here we goes with detail
$.ajax (s) :- its first and basic function for using ajax by Jquery.
Where s I can it collection of different properties which is enclosed in curly brackets "{ }"
1) $.ajax( {type : " GET/POST",
url : " any url" ,
data : "data1=rajat& data2=test", ( any data which you want to pass to the server…)
Success: function () {} , (any operation after successful readystate= 4)
cache : "TRUE/FALSE" ,
});

Ex:- To pass data from client to server we use following example
$.ajax({
type: "POST",
url: "SaveUser.aspx",
data: "name=RAJAT&Surname=JAISWAL",
success: function(msg){
alert( "Data Saved: " + msg );
}
} );

2)load(url) :- by the name it is clear that it will load html of a remote file and inject in current calling element.
Ex:- $("#dvResult").load("htmlPage1.htm");
it will load htmlPage1.htm 's html in div part
3) $.get(url) :- Simplest form to use http get request is $.get which is jquery.get(). We can send data along with this also which is optional part.
EX:- $("save.aspx",{name:"RAJAT", surname:"JAISWAL"});
suppose if want to take back result from Response. Then it has following format $("save.aspx",{name:"RAJAT", surname: "JAISWAL"} , function(data) { alert('do operation' + data);});
4)$.getJASON(url,data,function) :- To get response in json format we use this fuction its same as $get the diffrence here is only one that its respond in Json.
Ex- suppose from server the data return in json format which is { "info":[{ "strFirstName" :"Rajat" , "strLastName" : "Jaiswal"}]}
Then we do below code $.getJSON("default.aspx", function(data) { alert(data.info[0].strFirstName + data.info[0].strLastName); });
5) $.post(url,data,function):- it same as get method just a diffrence that it use post method to send data.
Ex:- $.post("save.aspx");
for more information just visit
http://indiandotnet.wordpress.com/tag/jquery/
Thanks
Rajat Jaiswal

Asp.net with Ajax Basic

------------
1. What is Ajax ?
Answer: Ajax Stands for Asynchronous JavaScript And XML. It’s a way to make web application like windows application, give use rich Interface.


2. How it Works ?
By working as a extra layer between user browser and server it handle server communication in background submit server request take response from server, the response data integrated in page seamlessly without post back of page. This layer often refers as AJAX engine or AJAx framework.
When ever you click on link or submit form by pressing button then you make a http request. So the page is post back.
XMLHttpRequest is object that can be handle with JavaScript and we can achive goal to take http request without postback.
When we using AJAX layer then we do asynchronous post back which means request to server made in background
The flow is as follows
Web page Request --> Make xml Http Request object -->
Send rquest to server -->
Monitor the request Status -->
Ready state Status -->
respond to client -->
get response-->
Process Return data

For any AJAX work you need to create a object of XMLHttpRequest for many browser you can create objects as follows
var request = new XMLHTTPRequest();
To achive same result in microsoft browser you have to do following thing
var request = new ActiveXObject("Microsoft.XMLHTTP");
But some different version use below definition
Var request = new ActiveXObject("Msxml2.XMLHTTP");
Or you can write as below
< script language ="JavaScript" type="text/script"
>
var request ;
function defineRequest(){
try {
request = new XMLHTTPRequest();
}
catch ( ex) {
try{
request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (ex1){
try{
request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(ex2){
}
}
}

}

XMLHttpRequest object will have following property :
1) onreadystatechange :- Determine which event handler will called when object ready state property changed
2) readyState :- there are following values for this
0 - un initialize
1 - loading
2 - loaded
3 - intractive
4 - completed
3)responseText :- Data return by Server in text format
4) responseXML :- Data return by server in XML format
5) status : - Http Status code
6) statusText :- Http Status Text

And it has following methods
Abort() :- Stop the current Request.
getAllResponseHeaders() :- Return all headers as string
getResponseHeader(x) :- get the x header value in string
Open('Method',url, a) :- specify the Method post /get
url for request
a= true/false determine whether the request handle asynchronously or not.
Send(content) : send a request ( default post data method)

3. Basic Example
As part of AJAX basic I just come with below example in this we create two page one is with server coding & another with client coding.
My main aim here to get result by ajax with out post back so we just try to get current time as result.
For this we write code in default.aspx page as below
<
script language ="javascript" type="text/javascript"
>
var myServerRequest;
function callAjax() {
try {
myServerRequest = new XMLHttpRequest();
myServerRequest.status

}
catch (ex) {
try {
myServerRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (ax) {
try {
myServerRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (ax1) {
return false;
}
}
}
}
function Callserver() {
callAjax();
if (myServerRequest != null) {
myServerRequest.open('GET', "serverCode.aspx", true);
myServerRequest.onreadystatechange = myServerResponse;
myServerRequest.send();
}
return false;
}
function myServerResponse() {
if (myServerRequest.readyState == 4) {
if (myServerRequest.status == 200) {
document.getElementById('dvResult').innerHTML = myServerRequest.responseText;
} else {
document.getElementById('dvResult').innerHTML = 'Oops Error';
}
}
return false;

}
script
>
Here we have 3 main function
1. CallAjax :- it is responsible for Assigning XMLHttpRequest Object.
2. myserverResponse :- by the name it is clear that it use for holding the result what ever pass by server.
3. callServer :- This function is call on any event on button and it sum up the above 2 events.
On server Page at page load we do following code

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Write(Now.ToString)
Response.End()
End Sub
Here we just write time as response then we end response.

If you do not do response.end() then html of server page also comes.

5. What is JASON ?
Ans: JASON is JavaScript Object Notation. It’s a light weight Data interchange format which is independent from language. Its easy to read & Write by human & easy to parse & genrate by language. The attributes is seprated with "," (comma) and value of attributes are define after colon symbol(":") .
Ex:- {Data:[{"fname" : "RAJAT", "Lname" : "JAISWAL" }]}
The above is JASON example in which there are two attributes fname, Lname and the are seprated by "," (comma) symbol.
And there value is "RAJAT" & JAISWAL" which are define after ":" (colon)symbol.

for more information just copy paste "http://indiandotnet.wordpress.com/category/aspnet/ajax/"

Thanks
Rajat Jaiswal

How to show image logo of your site?

Hello friends,
You have seen this website the like www.google.com, www.Yahoo.com, www.rediff.com,www.asp.net and many more provide a logo in the address bar or we can say website logo.
If you don't know how to use it you are much excited how this thing is done. First I will tell you that particular icon is called "Favicon" in technology term.
A favicon is an icon image which you can create from many Site or your own also.
Many sites provide favicon generator for example: - http://tools.dynamicdrive.com/favicon/
On this website just upload your image files and creates your favicon.
Once you done with favicon, then next thing is how to use that favicon so not to worry in that case also it is very simple just copy paste below lines and replace with your favicon icon path.
<
link id="Link1" runat="server" rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
< link id="Link2" runat="server" rel="icon" href="favicon.ico" type="image/ico"
/>

In the above line just replace the path and include this in your header same like CSS.
So enjoy with your site icon.
Thanks
Rajat Jaiswal

Merge SQL Files and run with batch Program with vb.net

Dear all,
I got a problem 2 days ago that I have to update my database with latest sps after a particular day but the problem is there is more than 20 sql files.
So either I have to run each file one by one or do some creativity. Just due to this what I did, made an applcation.
This application is exists for the merging all SQL file after a particular date and save that file with "Merge.sql" name and also it create Batch file to run and run the file on
Selected database.
I used Osql over here if you want to download code just download at http://www.indiandotnet.tk

Thanks
Rajat
Enjoy coding

How to download Youtube video on your system ?

Hello friends ,
you can easily download video by asp.net code for more information just click
below link
http://indiandotnet.wordpress.com/2009/02/28/how-to-download-youtube-video-on-your-system/

Thanks
Rajat

Binary Serialization example

Serialization in .NET allows us to take an instance of an object and convert it into a format that is easily transmittable over the network, or even stored in a database or file system.
This object will actually be an instance of a custom type, including any properties or fields you may have set.
Serialization is the process of converting an object into a stream of bytes which is easily transferable over the network and storing its current state on any permanent storage media like file or database for later use.
De-serialization is the reverse process of Serialization, where the stored object is taken and the original object is recreated.
.NET provides classes through its System.Runtime.Serialization namespaces that can be used for serializing and de-serializing objects.

Serialization can be divided into following types:
· Binary Serialization: Binary serialization allows the serialization of an object into a binary stream and restoration from a binary stream into an object.
· XML Serialization: XML serialization allows the public properties and fields of an object to be reduced to an XML document that describes the publicly visible state of the object.
· SOAP Serialization: SOAP serialization is similar to XML serialization in that the objects being serialized are persisted as XML.

Below is example how to make a serialize class
And how to serialize and deserialize class.
_
Private Class pvt_clsTest
Public strName As String = String.Empty
End Class


Private Sub pvt_SearializeMe()
Try
Dim cls As New pvt_clsTest
cls.strName = Me.txtNeedToSerialize.Text
Dim mem As New MemoryStream()
Dim binaryFormat As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
binaryFormat.Serialize(mem, cls)
Session("arr") = mem.GetBuffer
Me.txtSerialize.Text = mem.ToString
mem.Close()
Catch ex As Exception
Throw ex
End Try
End Sub

Private Sub pvt_DeserializeMe(ByVal arr As Byte())
Dim ascEn As New ASCIIEncoding
Dim mem As New MemoryStream(arr)
mem.Position = 0
Dim bf As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
Dim cls As pvt_clsTest = CType(bf.Deserialize(mem), pvt_clsTest)
Me.txtDeserialize.Text = cls.strName
mem.Close()

End Sub

for more information visit : http://www.indiandotnet.wordpress.com
Thanks
Rajat Jaiswal