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 Linksql
{
public partial class Form1:form
{
Public Form1 ()
{
InitializeComponent ();
}
private void Button1_Click (object sender, EventArgs e)
{
String Strcon, strSQL;
[Email protected] "Data source=.;i Nitial catalog=stumanage;integrated security=true ";
Strcon = "server=,;d atabase=stumanage;trusted_connection=true";
strSQL = "SELECT * from student";
SqlConnection mycon = new SqlConnection (Strcon);
SqlDataAdapter Myda = new SqlDataAdapter (strSQL, mycon);
DataSet myds = new DataSet ();
Myda. Fill (myDS, "dbo.student");
DataGridView1. Datasource=myds. Tables ["Dbo.student"];
}
private void Datagridview1_cellcontentclick (object sender, DataGridViewCellEventArgs e)
{
}
}
}