A sample Gridview can be created with the following code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="country" HeaderText="Country" ReadOnly="True" SortExpression="country" />
</Columns>
</asp:GridView>
The following code is used in the page_load event
string sql = "Select * from countries Order By Country";
SqlDataAdapter da = new SqlDataAdapter(sql, "Data Source=SSSLT71\\SQLEXPRESS08;Initial Catalog=Test;User ID=sa; password=123456");
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
Hope this will help you