using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WA_Table_Udao
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SqlConnection thisConnection = new SqlConnection(@"Data Source=HOME-PC\SQL2K8;Initial Catalog=ACCOUNTING1;Integrated Security=True");
private void button1_Click(object sender, EventArgs e)
{
//SqlConnection thisConnection = new SqlConnection(@"Data Source=HOME-PC\SQL2K8;Initial Catalog=ACCOUNTING1;Integrated Security=True");
SqlDataAdapter thisAdapter=new SqlDataAdapter("Select ColumnId,ColumnName From table_bnao",thisConnection);
SqlCommandBuilder thisCommandBuilder = new SqlCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "table_bnao");
//richTextBox1.Text = "";
//richTextBox1.Text += thisDataSet.Tables["table_bnao"].Rows[0][0];
dataGridView1.DataSource = thisDataSet.Tables["table_bnao"];
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text = dataGridView1.CurrentCell.Value.ToString();
}
private void button3_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Remove(dataGridView1.CurrentRow);
}
}
}
En esta página del sitio puede ver el video en línea Fill DataGridView by SqlConnection de Duración hora minuto segunda en buena calidad , que subió el usuario Ashish Jaryal 13 agosto 2012, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 920 veces y le gustó 1 a los espectadores. Disfruta viendo!