This is A C# Practice code:
Video For Result:
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- namespace dataentry
- {
- public partial class GetData : Form
- {
- public GetData()
- {
- InitializeComponent();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- SqlConnection abc = new SqlConnection("Data Source=.;Initial Catalog=dataentry;Integrated Security=True;Pooling=False");
- private void GetData_Load(object sender, EventArgs e)
- {
- SqlDataAdapter asdf = new SqlDataAdapter("select username,pass From LOGINWINDOW",abc);
- DataTable ss = new DataTable();
- asdf.Fill(ss);
- dataGridView1.DataSource = ss;
- }
- private void button11_Click(object sender, EventArgs e)
- {
- foreach (DataGridViewRow datarow in dataGridView1.Rows)
- {
- int num = dataGridView2.Rows.Add();
- foreach (DataGridViewColumn datacolumn in dataGridView1.Columns)
- {
- dataGridView2.Rows[num].Cells[datacolumn.Index].Value = dataGridView1.Rows[datarow.Index].Cells[datacolumn.Index].Value.ToString();
- }
- }
- }
- }
- }
Facebook Comment