SUPERIOR UNIVERSITY LAHORE
Bachelor in Information Technology
Department: Computer Science & Information Technology
Subject: Database Systems
TASK: 09 (COMMAND EXECUTION QUERY RESULT)
Student name: M Rabi
Roll No: BITM-S20-002
Create function for text box:-
private void button2_Click(object sender, EventArgs e)
if ([Link] == "" && [Link] == "")
[Link]("Please enter the data");
else
SqlConnection connection = new SqlConnection("Server=ELITEBOOK\\
SQLEXPRESS; initial catalog=Labtask; Integrated Security=True;");
SqlCommand command = new SqlCommand("update tblstudent set
name=@name, Rollnumber=@Rollnumber where name=@name ");
[Link]("@name", [Link]);
[Link]("@Rollnumber", [Link]);
[Link] = connection;
[Link]();
[Link]();
[Link]();
[Link]("Thank You For updation!");
reset();
}
}
private void Form1_Load(object sender, EventArgs e)
void reset()
[Link]();
[Link]();
Screen shot:
Work : 2:-
EXECUTION EMPTY PROCESS CHECKING
CODE:
if ([Link] == "" && [Link] == "")
[Link]("Please enter the data");
else
SqlConnection connection = new SqlConnection("Server=ELITEBOOK\\
SQLEXPRESS; initial catalog=Labtask; Integrated Security=True;");
SqlCommand command = new SqlCommand("update tblstudent set
name=@name, Rollnumber=@Rollnumber where name=@name ");
[Link]("@name", [Link]);
[Link]("@Rollnumber", [Link]);
[Link] = connection;
[Link]();
if ([Link]() > 0)
[Link]("Thank You For updation!");
else
[Link]("INVALID DATA!");
[Link]();
reset();
SCREEN SHOT