Tuesday, July 13, 2010

SQL Query

Select * from student where studid not in (select studid from studentdetails union select -1 as studid)

Friday, March 19, 2010

File Filter

//openFileDialog1.Filter = "Media files (*.wmv)|*.wmv|All Files (*.*)|*.*";
// openFileDialog1.Filter = "Media files (*.wmv)|*.wmv";

Monday, March 15, 2010

my mail check link

general mphasis url

https://my.mphasis.com/default.aspx



LAAS

https://hrapps.corp.mphasis.com/Authentication/Login.aspx?APPTOKEN=f52dab7a-5a23-45ae-985b-a298ec385f1f&URL=https://hrapps.corp.mphasis.com/LAAS/Admin%20Pages/Default.aspx


MARS


https://marshr.corp.mphasis.com/psp/HRPROD/?cmd=login&languageCd=ENG&

EDS mail box url


https://uspl.webmail.eds.com/exchange/



MPHASIS MAIL BOX


https://mail.mphasis.com/exchange/


oracle link

http://mars.corp.mphasis.com/OA_HTML/AppsLocalLogin.jsp?langCode=US&username=NZ3HHC

Pay Roll Link

http://employeepay.mphasis.com:8080/mphasis/home.do

Saturday, March 13, 2010

Flash Screen in Windows Application

Add windows form.

add two timer control in that form

set form background as white

do the complition with help of following code



using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Text;

namespace gridcomputing
{
public partial class frmSplashScreen : Form
{
#region "VARIABLES"

protected int intCurrentGradientShift = 10;
protected int intGradiantStep = 5;
#endregion

#region "CONSTRUCTOR"
public frmSplashScreen()
{
InitializeComponent();
}
#endregion

#region "FORM LOAD"
private void frmSplashScreen_Load(object sender, EventArgs e)
{

}
#endregion

#region "TIMER TICK"
private void tmrAnimation_Tick(object sender, EventArgs e)
{
// Obtain the Graphics object exposed by the Form.
Graphics grfx = CreateGraphics();
// Set the font type, text, and determine its size.

Font font = new Font("TIMES NEW ROMAN", 40,
FontStyle.Regular , GraphicsUnit.Point);

string strText = " Quality of Service \n" +
" in \n" +
" Grid Computing \n";

SizeF sizfText = new SizeF(grfx.MeasureString(strText, font));

// Set the point at which the text will be drawn: centered
// in the client area.

PointF ptfTextStart = new PointF(Convert.ToSingle(ClientSize.Width - sizfText.Width) / 2,
Convert.ToSingle(ClientSize.Height - sizfText.Height) / 2);

// Set the gradient start and end point, the latter being adjusted
// by a changing value to give the animation affect.
PointF ptfGradientStart = new PointF(0, 0);
PointF ptfGradientEnd = new PointF(intCurrentGradientShift, 200);
// Instantiate the brush used for drawing the text.
LinearGradientBrush grBrush = new LinearGradientBrush(ptfGradientStart,
ptfGradientEnd, Color.Maroon, BackColor);
// Draw the text centered on the client area.
grfx.DrawString(strText, font, grBrush, ptfTextStart);
grfx.Dispose();
// Shift the gradient, reversing it when it gets to a certain value.
intCurrentGradientShift += intGradiantStep;

if (intCurrentGradientShift == 500)
{
intGradiantStep = -5;
}
else if (intCurrentGradientShift == -50)
{
intGradiantStep = 5;
}
}

private void timer1_Tick(object sender, EventArgs e)
{
this.Close();
}
#endregion

}
}

Thursday, March 11, 2010

Personal Usefull link

PAN CARD TRACK LINK

http://www.utitsl.co.in/utitsl/site/pantracker.jsp

Saturday, March 6, 2010

Global Assembly Cache

Global Assembly Cache
To create a small Class Library project by using Visual Studio .NET or Visual Studio 2005, to generate a strong name, and to install the project's .dll file in the Global Assembly Cache, follow these steps:

1. Open Visual Studio .NET or Visual Studio 2005.
2. Create a new Class Library project named GAC in Visual Basic .NET or in Visual Basic 2005.
3. A strong name is needed. To generate this cryptographic key pair, use the SN Tool, which is located in the \bin subdirectory, where the .NET Framework Solution Developer Kit (SDK) is installed. The SN Tool is very easy to use. The command-line statement takes the following form:
sn -k "C:\[DirectoryToPlaceKey]\[KeyName].snk"
4. For convenience, create a directory named GACDemo in C:\ so that you can easily locate the key and access the key from the command prompt.

NOTE: For most users, the .NET tools are located in C:\Program Files\Microsoft.NET\FrameworkSDK\Bin. Before you type the following SN command, you may want to copy this similar path on your computer to the .NET bin directory, type cd from the command prompt, right-click to paste the path, and then press ENTER to quickly change the directory where the SN Tool is located.

Type the following:
sn -k "C:\GACDemo\GACkey.snk"
Note In the .NET Framework 2.0, the .NET tools are located in the C:\Program Files\Microsoft.NET\SDK\v2.0\Bin folder.
5. A key is generated, but it is not yet associated with the project's assembly. To create this association, double-click the AssemblyInfo.vb file in the Visual Studio .NET or Visual Studio 2005 Solution Explorer. Add the following to the list of assembly attributes that are included in this file by default when a project is created in Visual Studio .NET or in Visual Studio 2005:

Compile the project by clicking CTRL+SHIFT+B. No further code is necessary at this point in order to install a .dll file in the GAC.
6. You can install the .dll file by using the Gacutil Tool or by dragging the .dll file into the appropriate directory. If you use the Gacutil Tool, you can use the following command:
gacutil -I "C:\[PathToBinDirectoryInVSProject]\gac.dll"
If you want to drag the file, use Microsoft Windows Explorer. Open two instances of Windows Explorer. In one, navigate to the location of the .dll file output for your console project. In the other, navigate to c:\[SystemRoot]\Assembly.

Drag your .dll file into the folder.

Saturday, February 27, 2010

Crystal Report in Windows Application

1. Add Crystal Report to Application give oledb(ado) connection
2. Select Corresponding Table and column


CrystalReport1 objRpt = new CrystalReport1();
objRpt.SetDataSource(ds.Tables[0]);
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Refresh();

Monday, February 15, 2010

Cursor Example

declare cursor_fetch cursor for select * from spt_values

open cursor_fetch

fetch cursor_fetch

close cursor_fetch

deallocate cursor_fetch

Sunday, February 14, 2010

using System.Collections;
public partial class sample : System.Web.UI.Page
{
Col < string > str = new Col < string > ();
Col < int > inser = new Col< int >();
protected void Page_Load(object sender, EventArgs e)
{
str.Val="hai";
str.Val = "hello";
inser.Val=1;
inser.Val = 2;
inser.Val = 3;
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = str.Val.ToString();
Button1.Text = inser.Val.ToString();
}
protected void Button2_Click(object sender, EventArgs e)
{
ArrayList al = new ArrayList();
for (int i = 0; i < 100; i++)
{
al.Add(i);
}
DropDownList1.DataSource = al;
DropDownList1.DataBind();
}
}
public class Col< T >
{
T t;
public T Val
{
get
{
return t;
}
set
{
t = value;
}
}
}

.net Framework 2.0 Feature

Partial Class - Two more user can work with same class name

Master Page - Master Design Applied to Child Page

Ajax Control - Used to Design good webpage

Generics - Handle two different Datatype in Array List

.net Framework 3.5 Feature

WPF- Windows Presentation Foundation

WCF- Windows Communication Foundation

WF- WorkFlow Foundation

Linq

Friday, February 12, 2010

Cursor Example in SQL Server

declare cursor_content cursor for select * from content

open cursor_content

fetch next from cursor_content

close cursor_content

deallocate cursor_content

Thursday, February 11, 2010

ImageStoring and Retrieval In Windows Application Using C#

// Storing of the Image //

MemoryStream stream = new MemoryStream();
pictureBox1.Image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] pic = stream.ToArray();
cmd.Parameters.AddWithValue("@img", pic);
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();

// Retrieval of the Image //

SqlDataAdapter ada = new SqlDataAdapter(cmd);
ds = new DataSet();
ada.Fill(ds);
byte[] bytes = (byte[])ds.Tables[0].Rows[0][1];
MemoryStream mem = new MemoryStream(bytes);
Bitmap map = new Bitmap(mem);
pictureBox1.Image = map;


// Display Using Timer Values //


private void timer1_Tick(object sender, EventArgs e)
{
Bitmap map ;
if (cnt < ds.Tables[0].Rows.Count)
{
byte[] bytes = (byte[])ds.Tables[0].Rows[cnt][1];
MemoryStream mem = new MemoryStream(bytes);
map = new Bitmap(mem);
pictureBox1.Image = map;
cnt += 1;
}
else
{
cnt = 0;
}
}

Webapplication Word Document posting

Int32 File1Length = FileUpload1.PostedFile.ContentLength;
System.IO.Stream File1Stream;
File1Stream = FileUpload1.PostedFile.InputStream;
byte[] File1Content = new byte[File1Length];
File1Stream.Read(File1Content, 0, File1Length);

Saturday, January 30, 2010

How to Delete a row from datatable

dt.Rows[i].Delete();

Or

foreach (DataRow dr in dt.Rows)
{
if ((dr["Doc_Name"].ToString().Trim() == "RAJA".ToString()))
{
dr.Delete();

}
}
dt.AcceptChanges();

Hot Create Random Number Using C#

Random randNum = new Random();

int i = randNum.Next(0, 10);

Friday, January 8, 2010

Bug Fixing in .net

1) Microsoft company website not open&surfing


1. First Try Windows malicious Removal program

if it's not solve the problem try another option

2. Stop dns client service in local service

2) Error while trying to run project: cannot start debugging. The assembly to be debugged was built with a platform incopatible with the current system


But i figured out the probelm and it seems to be a bug in Visual Studio 2005.

There is something called as the configuration Manager where u can specify the the type of the target machine code u want .. say X86 or X64. There is also this ANY CPU option( default).

But looks like there is a goof up in the menu associated and if u select the target machine to be X64 u get an exe which can run on any cpu and if the setting is is ANY CPU u can run it only on X64 !!!!!!