////for shutdown pc in c#
System.Diagnostics.Process.Start("shutdown", "/s /t 0");
private void button1_Click_1(object sender, EventArgs e)
{
string strinsert = "select * from registration where emailid='" +
txtusername.Text + "' and passward='" + txtpassward.Text + "'";
DataTable dt = new DataTable();
dt = con.select(strinsert);
if (dt.Rows.Count > 0)
{
m.menuStrip1.Visible = true;
this.Close();
// r.Close();
}
else
{
MessageBox.Show("INVALID USERNAME AND PASSWARD");
}
}
%%%%%coding to database grdvw
private void Form1_Load(object sender, EventArgs e)
{
//dataGridView1.ColumnCount = 3;
//dataGridView1.Columns[0].Name = "Product ID";
//dataGridView1.Columns[1].Name = "Product Name";
//dataGridView1.Columns[2].Name = "Product Price";
//string[] row = new string[] { "1", "Product 1", "1000" };
//dataGridView1.Rows.Add(row);
//row = new string[] { "2", "Product 2", "2000" };
//dataGridView1.Rows.Add(row);
//row = new string[] { "3", "Product 3", "3000" };
//dataGridView1.Rows.Add(row);
//row = new string[] { "4", "Product 4", "4000" };
//dataGridView1.Rows.Add(row);
}
// FOR IMAGE INSERT
File.Copy(txtopen.Text,
Path.Combine(Application.StartupPath+"\\image", Path.GetFileName(txtopen.Text)),true);
label1.Text = "image saved successfully";
// pbopen.Image.Save(Application.StartupPath +
"\\IMAGE\\picture1.jpg");