0% found this document useful (0 votes)
5 views2 pages

C# Private Void Methods Overview

This document contains code snippets for three different tasks: 1) Shutting down a PC using C# by calling the shutdown command. 2) Authenticating a user by checking username and password against a database table. 3) Populating a data grid view with sample product data.

Uploaded by

kishor
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

C# Private Void Methods Overview

This document contains code snippets for three different tasks: 1) Shutting down a PC using C# by calling the shutdown command. 2) Authenticating a user by checking username and password against a database table. 3) Populating a data grid view with sample product data.

Uploaded by

kishor
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

////for shutdown pc in c#

[Link]("shutdown", "/s /t 0");

private void button1_Click_1(object sender, EventArgs e)


{

string strinsert = "select * from registration where emailid='" +


[Link] + "' and passward='" + [Link] + "'";
DataTable dt = new DataTable();
dt = [Link](strinsert);

if ([Link] > 0)
{

[Link] = true;
[Link]();
// [Link]();
}
else
{
[Link]("INVALID USERNAME AND PASSWARD");
}
}

%%%%%coding to database grdvw

private void Form1_Load(object sender, EventArgs e)


{
//[Link] = 3;
//[Link][0].Name = "Product ID";
//[Link][1].Name = "Product Name";
//[Link][2].Name = "Product Price";
//string[] row = new string[] { "1", "Product 1", "1000" };
//[Link](row);
//row = new string[] { "2", "Product 2", "2000" };
//[Link](row);
//row = new string[] { "3", "Product 3", "3000" };
//[Link](row);
//row = new string[] { "4", "Product 4", "4000" };
//[Link](row);
}
// FOR IMAGE INSERT

[Link]([Link],
[Link]([Link]+"\\image", [Link]([Link])),true);
[Link] = "image saved successfully";
// [Link]([Link] +
"\\IMAGE\\[Link]");

You might also like