September 12, 2008 by dhavalshah
To Add Flash into your winforms is difficult task compair to adding flash object on webpage.here i have mention the steps to add flash control into your windows application.
- You need to add the Shockwave ActiveX control that will host your Flash movie to the Visual Studio toolbox.Right click the toolbox, and select Add Tab to add a new toolbox tab. Next you should rename it to something meaningful. You need to generate an InterOp Assembly to be able to use the ActiveX control on a WinForm.
- Right click the toolbox,and select Choose Item that will pop up the Customize Toolbox Dialog.Go to the COM Components tab and search for Shockwave Flash Object and click the OK Button.
- After Finish all sep that mention above place that code on Load Events of the form.
1: AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash();
2: string PAth = System.Environment.CurrentDirectory;
3: PAth += @"\index2.swf";
4:
5: axShockwaveFlash1.Dock = DockStyle.Fill;
6: panel1.Controls.Add(axShockwaveFlash1);
7: axShockwaveFlash1.LoadMovie(0, PAth);
8: axShockwaveFlash1.Play();
Posted in C# | Leave a Comment »
September 11, 2008 by dhavalshah
Why Use Java Script Timer?
In my recent application i have done one task that After 15 sec page redirect automatically and that page display the remaining time.To done that i have use the java script timer.
Step To Achive Timer In Java Script
1). Copy belowed script after Head Tag In your ASPX file
1: <script language="javascript" type="text/javascript">
2:
3: var mins,secs,TimerRunning,TimerID;
4: TimerRunning=false;
5:
6: function Init() //call the Init function when u need to start the timer
7: {
8: mins=0; // set Minite For Redirect
9: secs=10; // Set Second For Redirect
10: StopTimer();
11: StartTimer();
12: }
13:
14: function StopTimer()
15: {
16: if(TimerRunning)
17: clearTimeout(TimerID);
18: TimerRunning=false;
19: }
20:
21: function StartTimer()
22: {
23: TimerRunning=true;
24: window.status="Time Remaining "+Pad(mins)+":"+Pad(secs);
25: document.getElementById("Label1").innerHTML = "Time Remaining " + Pad(mins) + ":" + Pad(secs);
26: TimerID=self.setTimeout("StartTimer()",1000);
27:
28: Check();
29:
30: if(mins==0 && secs==0)
31: {
32: StopTimer();
33: self.location = "GoogleMap.htm"; // Redirect URL
34: }
35:
36: if(secs==0)
37: {
38: mins--;
39: secs=60;
40: }
41: secs--;
42: }
43:
44: function Check()
45: {
46: //if(mins==1 && secs==0)
47: //alert("You have only five minutes remaining");
48: //else if(mins==0 && secs==0)
49: //{
50: //alert("Your alloted time is over.");
51: //}
52: }
53:
54: function Pad(number) //pads the mins/secs with a 0 if its less than 10
55: {
56: if(number<10)
57: number=0+""+number;
58: return number;
59: }
60:
61: </script>
2). Paste this line between form tag of your ASPX page.
1: <div>
2: <asp:Label ID="Label1" Width="205px" runat="server"></asp:Label>
3: </div>
3). After Finish all steps that mention above at last put this code on body tag.
Posted in ASP.Net | 2 Comments »
April 25, 2008 by dhavalshah
- In Sql server 2005 we can Encrypt & decrypt our data using this function.
// For Encryption
EncryptByPassPhrase('Key Value','Text')
// For Decryption
cast(DecryptByPassPhrase('Key Value',Encrypted Text) as varchar(16))
Key Value :- Value Of Key That is use For Encryption & Decryption Process.
Text :- In That Perameter Pass the Text That can be Encrypt.
Posted in SQL Server | Leave a Comment »
April 16, 2008 by dhavalshah
If you have ever worked with Microsoft Access, you might have used the TRANSFORM statement to create a crosstab query.
Even though the similar functionality was missed in sql server 2000, we can achieve the same in SQL Server 2005 via the PIVOT operator with the SELECT statement.
The PIVOT operator can be used to transform a set of rows into columns while the UNPIVOT operator complements the PIVOT operator by allowing you to turn columns into rows.
Posted in SQL Server | Leave a Comment »
April 16, 2008 by dhavalshah
1). With Help Of master.sys.xp_dirtree Function We get the directory structure of windows System.
This Function Accept One Parameter.
In This Pareamter give the Location.
below give code for getting structure of windows file system.
EXEC master.sys.xp_dirtree ‘c:\Inetpub’
Posted in SQL Server | Leave a Comment »
April 16, 2008 by dhavalshah
There is a syntax of getting database name & status from sql server.
SELECT DB_NAME() AS DatabaseName, DATABASEPROPERTYEX('master', 'Status') AS DBStatus
Posted in SQL Server | Leave a Comment »
April 14, 2008 by dhavalshah
1). Create XML File That Used In this Reports.
So,How To Create That XML File.
1). To Creating that XML Using Dataset.
2). First Fill Dataset From DataAdapter.After That there is one property WriteXMLSchema Of Dataset.In this Property write the XML FIle Name.
2). After Creating that XML File.Right Click On Project And Click On Add New Item.While Click On that One Open Dialog Box Appear.From that Dialog Box Click On Crystal Report.That will Add One Crystal Report On your Solution.
3). After Creating Rpt File Follows That Following Steps.
1). Add Datasource Of that newly created Crystal Report And Click On Database Expert… link.
2). Click On That One Dialog Box Appear that Describe below.

3). When Expand that Database files Option It will ask the Location Of that XML give.Give the location Of that XML File.
4). After Click On Open Button This Screen Appear.From That Choose the Table that will see on that Report.
4). All This Task Complate That Write the below code For Bind the Data To ReportViewer .
ReportDocument rdoc = new ReportDocument();
// Path Of That Report Document File In Load Function Parameter.
rdoc.Load(@”C:\Documents and Settings\xosysadmin\My Documents\Visual Studio 2005\Projects\GivingXMLToRpt\GivingXMLToRpt\Testrpt.rpt”);
// Give the Dataset Name That Assing To Report Document
rdoc.SetDataSource(ds);
// Viewer Name . ReportSource = That Report Document Object Name
crystalReportViewer1.ReportSource = rdoc;
Posted in Crystal Report | 6 Comments »