Adding a Primary Key Constraint
on Column
ALTER TABLE employee ADD
CONSTRAINT emp_id_pk PRIMARY KEY(emp_id)
Increasing the width of a column
ALTER TABLE employee ALTER
COLUMN emp_name varchar(100)
Decreasing the width of a column
ALTER TABLE employee ALTER
COLUMN emp_name varchar(50)
Changing the Data Type of Column
ALTER TABLE employee ALTER
COLUMN emp_name nvarchar(50)
Add a NULL Constraint on Column
ALTER TABLE employee ALTER
COLUMN emp_name nvarchar(50) NULL
Add a NOT NULL Constraint on
Column
ALTER TABLE employee ALTER
COLUMN emp_name nvarchar(50) NOT NULL
Add a new Column on Table
without any Constraint
ALTER TABLE employee ADD
emp_age varchar(10)
Add a new Column on Table with a
Constraint
ALTER TABLE employee ADD
emp_code varchar(100) CONSTRAINT emp_code_uq UNIQUE
Drop a Column from Table
ALTER TABLE employee DROP
COLUMN emp_code
Adding a Check Constraint Column
ALTER TABLE employee ADD CONSTRAINT
emp_age_ck (emp_age > 18)
Here is the our aspx page that contains a JavaScript
method and a hidden filed and button.
<script
type="text/javascript">
function SetValue() {
var sValue = "Hello
World";
document.getElementById("Hidden1").value
= str;
}
</script>
<html>
<head>
<title>How to set c# variable value
in javascript</title>
</head>
<body>
<div>
<asp:hiddenfield id="hdnVlaue" runat="server"></asp:hiddenfield>
<asp:button id="btnClick" runat="server"
onclientclick="SetValue()" onclick="”" text="Click
Me"> </asp:button>
</div>
</body>
</html>
Now in the click event of the btnClick, we will set value
received by JavaScript function
protected void btnClick_Click(object sender, EventArgs e)
{
string sValue = hdnVlaue.Value;
Response.Write("The
Received Value is " + sValue);
}
using System;
using System.Net.Mail;
using System.Net.Security;
public partial class SendEmailPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MailMessage oMailMessage = new MailMessage("Your Email Address
", "Recepent’s
Email Address ");
oMailMessage.Subject = "Write Your Mail Here";
oMailMessage.Body = "Write Your Email Message";
oMailMessage.IsBodyHtml = false;
SmtpClient oSmtpClient = new SmtpClient("smtp.gmail.com", 587);
oSmtpClient.Credentials = new System.Net.NetworkCredential("Email Username", "Email Password");
oSmtpClient.EnableSsl = true;
oSmtpClient.Send(oMailMessage);
}
}
using System;
using System.Web;
using System.Web.UI;
public partial class GetDeviceType : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected override void OnInit(EventArgs e)
{
string sUserAgent = Request.UserAgent.ToLower();
if (sUserAgent.Contains("tablet"))
{
this.MasterPageFile = "/Tablet.master";
}
else
{
this.MasterPageFile = "/Mobile.master";
}
}
}
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
public partial class AddMetaTageProgrammatically : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Adding Title
Page.Title = "How to add meta tags
programmatically.";
//Adding Meta Descriptions
HtmlMeta oHtmlMetaDescription = new HtmlMeta();
oHtmlMetaDescription.Name = "description";
oHtmlMetaDescription.Content = "How to add meta tags
programmatically in asp.net with c#.";
Page.Header.Controls.Add(oHtmlMetaDescription);
oHtmlMetaDescription = null;
//Adding Meta Keywords
HtmlMeta oHtmlMetaKeywords = new HtmlMeta();
oHtmlMetaKeywords.Name = "keywords";
oHtmlMetaKeywords.Content = "meta tags, adding meta
tags programmatically, meta tags in asp.net";
Page.Header.Controls.Add(oHtmlMetaKeywords);
oHtmlMetaKeywords = null;
}
}
SqlCommand cmd;
SqlConnection con;
SqlDataAdapter da;
DataSet ds;
private void button1_Click(object sender, EventArgs e)
{
con = new SqlConnection("your_database_connection_sting");
cmd =new SqlCommand ("select * from emp", con);
da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
comboBox1.Items.Add(ds.Tables[0].Rows[i][0] + " " + ds.Tables[0].Rows[i][1] + " " + ds.Tables[0].Rows[i][2]);
}
}
SqlConnection con;
SqlDataAdapter da;
DataSet ds;
private void button1_Click(object sender, EventArgs e)
{
con = new SqlConnection("your_database_connection_sting");
cmd =new SqlCommand ("select * from emp", con);
da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
comboBox1.Items.Add(ds.Tables[0].Rows[i][0] + " " + ds.Tables[0].Rows[i][1] + " " + ds.Tables[0].Rows[i][2]);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication
{
class sub
{
int a=9,b=9,c;
public void m2()
{
c = a - b;
Console.WriteLine("result
is" + c);
}
}
class program
{
static void Main(string[] args)
{
sub a = new sub();
a.m2();
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
//int
a=9,b=9;
//int
c=a+b;
//user
give input through the key board
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = a + b;
Console.WriteLine("addition of
two numbers" + c);
Console.ReadKey();
}
}
}
Web
Based Meeting Scheduler
It’s an online
application used for effectively schedule meeting with user friendly feature.WMS is to support the organization of
meetings in a way so that most of the intended participants shall effectively
participate. Scheduler or the manager will schedule the meeting by providing
necessary details required for the meeting such as date of meeting, room for
the meeting, slot or time for the meeting etc.
Can send the invitation to all or selected employee working under
him/her. Also the employees can respond to the meeting , view the meeting
scheduled.
This
web based application is used to schedule meetings among a team of workers. It is applicable to those in a
company for which it is designed.
Users who have an access to this website can edit their profile, check
for the meetings organized and can give confirmation about meeting. In our web
application, admin approves access to
only those persons who are in the company and are active.
Existing system:
In the previous system, we can arrange meetings but we won’t have
specific modules like admin, meeting organizer and meeting attendee. Also these
websites specifically have not been designed to provide an interface between
the organizer and participant.
Previous systems did not had the facility of sending mails. It did not
provide individual profiles to each user. Security is also low. This has been
overcome in our proposed system.
Proposed system:
In the proposed system , we are developing a website, known as Meeting
Scheduler ,to schedule the meeting and also to provide interface between the
users of the website, that is between the organizer and participant. Only
authenticated and authorized users are allowed to access and use our website.
Users can have an account in our website only when their request has been
approved by admin. Security is very high.
Each user have their own profile. The system provides facility to send
mails by linking it to gmail or yahoo. The organizer can send mails from
his/her account. It has information about the conference rooms. It offers technologies which well-developed
companies provide. It has improved processing and technical efficiency.
Modules
Description:
This system consists of three modules
namely admin, meeting organizer and meeting attendee/participant.
Admin will control our application and can
accept or reject a request from user. Admin manages the database, modifies the
information of a user, updates details about conference rooms, adds or removes
project meetings and view the scheduled meetings.
Organizer can schedule the meetings, send invitation
to the participants, edit meeting details and notify the attendee of any
changes.
Participant can view the meeting details, give
his/her acceptance for the meeting.
Software requirements:
o Microsoft .Net framework 3.5
o Microsoft Visual Studio 2008
o Microsoft C#.Net language
o Microsoft SQL Server 2005
o ADO.NET
Hardware Requirements:
Processor : Intel Pentium 4 or more
Ram : 1 GB or more
Hard
disk : 40 GB hard disk recommended for
primary partition.
Virtual Reality Desktop
Most
users often have many Windows open at once, and so often will use a Virtual
Reality Desktop to help organize their Windows. This helps us to create and switch between different
desktops. It even gives you an
illusion of switching
the application from one desktop to another. But, it's just an illusion. The application will be closed in
the current desktop and will be launched on the specified desktop.
This Virtual
Reality Desktop lets you organize applications over several virtual desktops (also called 'workspaces'). User is presented with options and
menu for switching between desktops. This application is using hooks to display
‘Move To’ menu options in system tray.
Modules / Functionalities:
In
this project we have 3 functionalities:
- Configuration
- Windows Hooks
- Widows Recovery
Configuration: In this we can configure
the no.of virtual desktops need to display. And also can configure the buttons
layout.
Windows
Hooks:
Windows Hooks is a mechanism used to minimize any application to the system
tray. Hooks is a mechanism provided by Microsoft with which one can intercept
events before they reach an application. We can tray/ untray the selected
application into the system tray using windows hooks.
Windows
Recovery:
Using windows recovery, user can recover
the windows when windows did not shut down correctly last time.
Technologies used:
- .NET Framework 3.5.
- Visual Studio IDE 2008.
Screen Shot Hacker
Description of the
project:
In the present scenario, there may be situation where the Manager
of a company wants to check his employee’s status frequently in some time
intervals. So in that situation, it may not be that feasible if the manager
goes frequently to the employee and checks the status of that employee and this
makes the employee to feel uneasy about his manager. Evaluating this scenario,
we are trying to develop a Desktop Application where the screen shot of the
system is taken frequently in the given time interval and mailed it to the specified
mailed address. In this scenario, the manager may not find it difficult to go
to the employees each and every time and make the employee feel uneasy about
him.
Existing system:
In
the existing system we may not find any system where the screen shots are taken
and sent as a mail to the respective person mail id. This helps the user to
look for advanced system where in the person can access the system without ones
inter action.
Proposed system:
Considering the drawback in the
existing system, we are trying to develop application where in the screen shot
of the system is taken and mailed to the mail id of the user.
Modules:
- Login:
The user has to give his details and it has to
validated and redirect the user to the home page.
- Screen Shot:
The timer will be started and in each interval
the application will take the screen shot and first saves it in a folder.
- Mail Sending:
After saving the screen shot in the folder, it is
then retrieved back and it will be attached as an attachment to the mail and
send it the specified mail address.
Software requirements:
o Microsoft .Net framework 3.5
o Microsoft C#.Net language
o Micorsoft Sql Server 2005
Hardware
requirement:
Processor : Intel Pentium or more
Ram : 256 MB or more
Hard disk : 40 GB hard disk recommended for
primary partition.