private void BindData()
{
try
{
string _connectionstring = @"Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";
string _sql = "SELECT * FROM [Order Details] WHERE OrderID <= 10250";
SqlConnection _connection = new SqlConnection(_connectionstring);
SqlCommand _command = new SqlCommand(_sql,_connection);
SqlDataAdapter _adapter = new SqlDataAdapter(_command);
DataTable _table = new DataTable();
_adapter.Fill(_table);
GridView1.DataSource = _table;
GridView1.DataBind();
}
catch
{
throw;
}
}