December 11, 2008 by dhavalshah
Yahoo Media Player is a browser based MP3 player which lets you play music from any website quickly.
Yahoo Media Player, after inserting a javascript code to your pages, searches for the MP3 files and creates a playlist.
How to use Yahoo Media Player?
1) Link to audio :
Insert one or more anchor elements containing the URL of an audio file into your web page. For example:
1: <a href="example1.mp3">My first song</a>
2: <a href="example2.mp3">My second song</a>
2) Embed the Player :
Copy and paste this code into your page:
<script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script>
3) Use the player :
This play button will appear next to each of your audio links:
Press a play button. The Yahoo! Media Player will open.

Posted in Java Script | 3 Comments »
December 5, 2008 by dhavalshah
COMMING SOON ………………………………
Posted in C#, VB.Net | Leave a Comment »
November 12, 2008 by dhavalshah
To detect the Operating System on the Client Machine, your script should analyze the navigator.appVersion string. Below is a simple example of a script that sets the variable OSName to reflect the actual client OS.paste this script after the <Title> Tag of the <Head> Tag of the Page.
1: <script language="javascript" type="text/javascript">
2:
3: // This script sets OSName variable as follows:
4: // "Windows" for all versions of Windows
5: // "MacOS" for all versions of Macintosh OS
6: // "Linux" for all versions of Linux
7: // "UNIX" for all other UNIX flavors
8: // "Unknown OS" indicates failure to detect the OS
9:
10: var OSName="Unknown OS";
11: if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
12: if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
13: if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
14: if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
15:
16: document.write('Your OS: '+OSName);
17:
18: </script>
On your system, this script yields the following result: Your OS: Windows
(To get more detailed OS information, your script should perform a more sophisticated analysis of the navigator.appVersion string, but the idea would be the same.
)
Posted in Java Script | Leave a Comment »
November 11, 2008 by dhavalshah
To further aide debugging and assurance that you are in fact using your variables as you had intended for them to be used, ActionScript 2.0 has introduced strict data typing to the language. What this is, is the ability to specify what type a certain variable is when it’s created (Number, String, MovieClip, etc.). Then, should you ever attempt to try to use it as a variable of an alternative type, an error will occur thereby isolating a confliction helping you to debug.
Strict data typing also allows for Flash to associate a variable with an object to help you with code hints when using that object. Before, this was only possible using underscore suffixes in your variable naming. Now you have the option of using strictly typed variables instead, allowing for more room in your own naming conventions. (Note: XML definitions will still be needed for code hints to function properly.
Typing is always placed following a variable or function declaration. For variables, the type is placed immediately after the variable name separated by a colon (:). For functions, placement directly after the parameters list, also separated by a colon. Function types here, however, refer to the type of the value that the function is returning. If the function has no return, Void is used. Also, for functions, the parameters used can too be strictly typed.
1: var variableName:Type = value;
2: function functionName(parameter:Type):returnType {}
The following is an example of some variables and a function being strictly typed. Notice that when a type is given a value not matching its data type, an error occurs.
1: var name:String = "Joe";
2: var age:Number = 21;
3: function message(msg:String):Void {
4: trace(msg);
5: }
6:
7:
8: message(name); // traces "Joe"
9: message("Bob"); // traces "Bob"
10: message(age); // error: Type mismatch
Posted in Flash | Leave a Comment »
October 1, 2008 by dhavalshah
A thumbnail is a small sized image. Creating a thumbnail using .NET is extremely simple. In this article, we will explore how to create a thumbnail image and display the thumbnail in our application. Follow these steps:
- First Add Windows Form In your Application. After that Drag & drop 1 Label , 1 TextBox , 2 Buttons , 1 PictureBox & 1 OpenfileDialogBox Controls From Toolbox. Now change all the names of the controls that mention belowed.
1: TextBox Name = 'txtPath'
2: 1st Button Name = 'btnOpen'
3: 2nd Button Name = 'btnGenerate'
4: PictureBox Name = 'picthumb' And Set Height & Width = 100,100
- After renaming All the controls On the ‘btnOpen’ click display the File Open dialog box and accept the selected .jpg file in the ’txtPath’ textbox.
1: private void btnOpen_Click(object sender, EventArgs e)
2: {
3: if (openFileDialog1.ShowDialog().ToString() == "OK")
4: {
5: txtPath.Text = openFileDialog1.FileName;
6: }
7: }
- Next, on the ‘btnGenerate’ click, add the following code:
1: private void btnGenerate_Click(object sender, EventArgs e)
2: {
3: Image Img = null;
4: Img = Image.FromFile(txtPath.Text);
5: Image ImgThumbs = Img.GetThumbnailImage(100, 100, null, new IntPtr());
6: if (ImgThumbs != null)
7: {
8: picthumb.Image = ImgThumbs;
9: }
10: }
The code creates an Image object from the image supplied in the textbox. Using the Image.GetThumbnailImage(), the code then creates a thumbnail image with a size of 100*100.
The Image.GetThumbnailImage() takes in four arguments :
1: Width : in pixel of the thumbnail image that is to be generated
2: Height : in pixel of the thumbnail image that is to be generated
3: Callback : a Image.GetTumbnailImageAbort delegate to prematurely cancel execution
4: CallbackData : of type IntPtr to represent a pointer or a handle.
Run the application, select the image and click on the Generate button. The preview will be similar to the image displayed below :

Posted in C#, Dot Net | 1 Comment »
September 30, 2008 by dhavalshah
Why?
Let’s discuss one situation. There were so many tables in database and I have to change only one column of the table then how can I found this column is how many times used in any views or store procedure or any other database object. There is a ways to find this type of situation. First right click on the table and then click on dependency it will shows all the object that use this table but if I can see only that particular alter table column then there is no way to do that. After that problem I have found one solution that mention bellowed.
Description
First create one table valued function CheckDependancy in your database.That function script define belowed.
1: set ANSI_NULLS ON
2: set QUOTED_IDENTIFIER ON
3: go
4:
5:
6: Create function [dbo].[CheckDependancy](@dependanceobjectname Varchar(100))
7: RETURNS @DependanceTable TABLE (
8: [name] varchar(200),
9: [type] varchar(100)
10: )
11: AS
12: BEGIN
13:
14: INSERT @DependanceTable
15:
16: select distinct temp.name1,temp.TypeOf from
17: (
18: SELECT (case Obj.[type]
19: when 'FN' then 'Function'
20: when 'P' then 'Procedure'
21: when 'TR' then 'Trigger'
22: when 'TF' then 'Function'
23: when 'V' then 'View'
24: else 'None' end) AS TypeOf,obj.name AS name1,syscom.[text] from sys.objects As obj
25: INNER JOIN syscomments As syscom ON obj.object_id = syscom.id
26: WHERE obj.[type] in ('FN','V','TR','P','TF')
27: AND syscom.[text] like '%' + @dependanceobjectname + '%'
28: ) As temp Order By TypeOf
29:
30: return
31: END
32:
After Creating this function fire a query like
1: Select * from CheckDependancy('companyname')
This query will show all the view,store procedure or function name that use the companyname column.
Posted in SQL Server | Leave a Comment »
September 25, 2008 by dhavalshah
Recently I needed to fetch random rows from a SQL server table. If you have an integer column then using RAND() function goes well. However in my case there was no number column. In such cases you can use newid() function that is provide by SQL Server.
1). Create one Temporary table like Product.
1: create table Product
2: (
3: ProductId int,
4: ProductName varchar(100),
5: RetailPrice decimal(18,2),
6: ProductDesc varchar(1000)
7: )
2). After Creating that Product Table Insert Few rows like 100 rows.
3). Now fire the query that mention belowed.
1: select top 10 * from product
2: order by newid()
This query will return every time 10 random product.
This newid() function every time returns some random values. so when we order by from that function every time the product will different then the prev. :)
Posted in SQL Server | Leave a Comment »
September 23, 2008 by dhavalshah
When i started learing SQL Server one of the mistakes I did a few times was something like the following.
1: IF OBJECT_ID('Invoice') IS NOT NULL DROP TABLE Customers
2: GO
3: CREATE TABLE Invoice(
4: InvoiceId int,
5: InvoiceNo VARCHAR(10),
6: InvoiceStatus)
7: GO
8:
9: INSERT INTO Invoice(InvoiceId , InvoiceNo , InvoiceStatus) SELECT 1,'Jacob','Active'
10: INSERT INTO Invoice(InvoiceId , InvoiceNo , InvoiceStatus) SELECT 2,'Mike','Inactive'
11: INSERT INTO Invoice(InvoiceId , InvoiceNo , InvoiceStatus) SELECT 3,'Steve', NULL
12:
13: SELECT *
14: FROM Invoice
15: WHERE InvoiceStatus = NULL
Well, my queries never returned a row, even though there is a row in the table with a NULL value in InvoiceStatus column. Then I tried the opposite.
1: SELECT *
2: FROM Invoice
3: WHERE InvoiceStatus <> NULL
This did not return anything as well.
I realized that the result of a comparison operation that involves a NULL value is UNKNOWN. That is the reason why the above queries did not return any row. The correct way to write the queries is:
1: SELECT InvoiceNo,InvoiceStatus
2: FROM Invoice
3: WHERE InvoiceStatus IS NULL
4: /*
5: InvoiceNo InvoiceStatus
6: -------------------- --------------
7: Steve NULL
8: */
9: SELECT InvoiceNo,InvoiceStatus
10: FROM Invoice
11: WHERE InvoiceStatus IS NOT NULL
12: /*
13: InvoiceNo InvoiceStatus
14: -------------------- --------------
15: Jacob Active
16: Mike Inactive
17: */
So where does SET ANSI_NULLS fit in this story?
Well,the behavior of comparison operations (= and <>) when they are used with NULL values depends on the setting of this option. The default value of SET ANSI_NULLS is ON. This setting causes the behavior explained in the previous examples.
The two examples we saw at the beginning of this post will work correctly if we set ANSI_NULLS to OFF. The following example demonstrates that.
1: SET ANSI_NULLS OFF
2: SELECT InvoiceNo,InvoiceStatus FROM Invoice WHERE InvoiceStatus = NULL
3:
4: /*
5:
6: InvoiceNo InvoiceStatus
7: ---------- -------------
8: Steve NULL
9:
10: */
11:
12: SELECT InvoiceNo,InvoiceStatus FROM Invoice WHERE InvoiceStatus <> NULL
13:
14: /*
15:
16: InvoiceNo InvoiceStatus
17: ---------- -------------
18: Jacob Active
19: Mike Inactive
20:
21: */
Posted in SQL Server | 2 Comments »
September 22, 2008 by dhavalshah
In nova days i have faced one problem that was to debug store procedure that placed on remote sql server.I have found the solution to debug remote store procedure on .net platform.I have mention all the steps below to impliments remote store procedure debugging in .NET.
1). Microsoft SQL Server Provide rdbgsetup.exe file .with help of this file we can debug the remote store procedure.This file is placed on belowed location.
1: <sql server root folder>/90/Shared/1033/rdbgsetup.exe
2). After double Click On that rdgsetup.exe file this type of dialogbox appears.

3). Click On Next Button and check the accept terms & condition Checkbox and click on install button.

4). After Click On Install Button this picture will apears on your screen.

5). After Click on Next Button Another Dailog open that mention in below picture.
6). Now Configure Next step same as the picture that shown belowed.
7). After Click on Next Button.Add See the belowed Image.
8). click On Next Button that will finish all the configuration and appear the close screen that mention belowd.
9). After all this Steps over open the Microsoft Visual Studio and run the query.refer below image.
To Debug the storeprocedure Right Click on that and click on Step Into Stored Procudre .
Posted in ASP.Net, SQL Server | Leave a Comment »
September 16, 2008 by dhavalshah
Text to Speech is very usefull in Web Application as well as in windows application.Microsoft provide Speech Object Library that is use for this purpose.Here i have mention steps to implement text to speech in C#.
1). Add Speech Object Library reference to your Application using right click on Project & click on Add Reference.
2). After Adding Referece of Speech Object Library Drag one textbox control on your WinForm & give the name txttexttospeech.
3). After that put this belowed code on your page load event of the form.
1: SpVoice voice = new SpVoice();
2: voice.Voice = voice.GetVoices("Name=LH Michael", "Language=409").Item(0);
3: voice.Speak(txttexttospeech.Text, SpeechVoiceSpeakFlags.SVSFDefault);
Posted in C# | 6 Comments »