ALTER
PROCEDURE SeleccionarDatos
AS
/* SET NOCOUNT
ON */
select * from empleado
RETURN
En VB utiliza esto en el evento Load(dt es un DataTable):
Using Sql As New SqlConnection(My.Settings.cnn)
Sql.Open()
Dim
da As New SqlDataAdapter("exec
seleccionarDatos", Sql)
da.Fill(dt)
DataGridView1.DataSource = dt
End Using
SqlConnection sql=new SqlConnection(ConfigurationManager.ConnectionStrings["cnn"].ConnectionString);
SqlDataAdapter da;
DataTable dt;
private
void Form1_Load(object
sender, EventArgs e)
{
using(sql){
sql.Open();
using(da=new SqlDataAdapter("exec SeleccionarDatos", sql)){
dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
} } }