Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. asp.net datagrid not showing

asp.net datagrid not showing

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdesign
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    datainjector
    wrote on last edited by
    #1

    when adding the datagrid component and executing the asp web page it does not display ..Tried this on 3 diff computers and he result is same .The web page its self does not contain the datagrid control when executed .. Same goes for the dataList/table .... code.aspx.cs ------------ private OleDbConnection conn = new OleDbConnection(@"Provider = Microsoft.Jet.OleDb.4.0; Data Source = C:\Shirazagro.mdb"); private OleDbCommand cmd; private OleDbDataAdapter dataAdap; protected System.Web.UI.WebControls.DataGrid DataGrid1; private DataTable dt = new DataTable(); protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.TextBox TextBox2; protected System.Web.UI.WebControls.Table Table1; private void Page_Load(object sender, System.EventArgs e) { cmd = new OleDbCommand( "select * from supplier", conn ); dataAdap = new OleDbDataAdapter( cmd ); dataAdap.Fill( dt ); Response.Write( dt.Rows[0]["SupName"].ToString() ); DataGrid1.DataBind(); TextBox1.DataBind(); TextBox2.DataBind(); //DataGrid1.DataSource = dt; } code.aspx ----------

    M 1 Reply Last reply
    0
    • D datainjector

      when adding the datagrid component and executing the asp web page it does not display ..Tried this on 3 diff computers and he result is same .The web page its self does not contain the datagrid control when executed .. Same goes for the dataList/table .... code.aspx.cs ------------ private OleDbConnection conn = new OleDbConnection(@"Provider = Microsoft.Jet.OleDb.4.0; Data Source = C:\Shirazagro.mdb"); private OleDbCommand cmd; private OleDbDataAdapter dataAdap; protected System.Web.UI.WebControls.DataGrid DataGrid1; private DataTable dt = new DataTable(); protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.TextBox TextBox2; protected System.Web.UI.WebControls.Table Table1; private void Page_Load(object sender, System.EventArgs e) { cmd = new OleDbCommand( "select * from supplier", conn ); dataAdap = new OleDbDataAdapter( cmd ); dataAdap.Fill( dt ); Response.Write( dt.Rows[0]["SupName"].ToString() ); DataGrid1.DataBind(); TextBox1.DataBind(); TextBox2.DataBind(); //DataGrid1.DataSource = dt; } code.aspx ----------

      M Offline
      M Offline
      Marcie Jones
      wrote on last edited by
      #2

      Hi di, You need to uncomment this line, and place it before DataGrid1.DataBind(): //DataGrid1.DataSource = dt; Hope that helps! Marcie CP Blog[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups