Mid From PDF ADO.NET ADO.NET

Bind the data to the GridView. Example: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlConnection connection = new SqlConnection(connectionString); SqlDataAdapter adapter = new SqlDataAdapter("SELECT CustomerID, CustomerName FROM Customers", connection); DataTable dataTable = new DataTable();

dapter.Fill(dataTable);

GridView1.DataSource = dataTable;

GridView1.DataBind();

}
}

Here, GridView1 is bound to the data returned from the SQL query (SELECT

CustomerID, CustomerName FROM Customers), and the DataBind() method

displays it in the grid.

More from ADO.NET Core Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details