Mike Eghtebas
asked on
gridview not populating... asp.net c#
I have checked and made sure the table has data in it.
Question: Why the following code is not population the gridview?
Question: Why the following code is not population the gridview?
public partial class Default3 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ROD_July18ConnectionString"].ToString());
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
LoadData();
}
}
private void LoadData()
{
var da = new SqlDataAdapter("SELECT * FROM t08MedCenter", con);
var ds = new DataSet();
da.Fill(ds);
grdHighLight.DataBind();
}
}
----------------------------
<form id="form1" runat="server">
<div>
<asp:GridView runat="server" ID="grdHighLight" >
</asp:GridView>
</div>
</form>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Fernando,
I wonder if you have a moment to take a look at:
https://www.experts-exchange.com/questions/28504938/asp-net-html5-validation-question.html
In this question I have problem validating for html5. <asp:gridview... > generates its own inline css attributes and html5 doesn't like it.
FYI, I have used gridview from the toolbar; perhaps I need not to use gridview from the tollbar. Instead, I may have to populate this gridview from codebehinde to have a better control on its styling.
Thanks,
Mike
I wonder if you have a moment to take a look at:
https://www.experts-exchange.com/questions/28504938/asp-net-html5-validation-question.html
In this question I have problem validating for html5. <asp:gridview... > generates its own inline css attributes and html5 doesn't like it.
FYI, I have used gridview from the toolbar; perhaps I need not to use gridview from the tollbar. Instead, I may have to populate this gridview from codebehinde to have a better control on its styling.
Thanks,
Mike
I have looked at the other question but not being an web developer I would not be of any help, sorry.
ASKER
Thank you for the response.
Mike
Mike
Not a problem Mike, glad I was able to help.
ASKER
Mike