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. Problem with Connection ?

Problem with Connection ?

Scheduled Pinned Locked Moved ASP.NET
helpquestionwpfwcf
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.
  • P Offline
    P Offline
    Purish Dwivedi
    wrote on last edited by
    #1

    I am loading data from Access table into GridView, but it shows nothing in my Web Application after executing. What is wrong int this code?Plz help. This is my connection code. private void Binding() { // create the connection OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:/GmoteDeviceControl/App_Data/DeviceCtrl.mdb;User Id=admin;Password=;"); // Open the connection con.Open(); // create the DataSet DataSet ds = new DataSet(); // create the adapter and fill the DataSet OleDbDataAdapter da = new OleDbDataAdapter("Select * from SUBSCRIBER_DEVICES", con); da.Fill(ds); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); // close the connection con.Close(); }

    A 1 Reply Last reply
    0
    • P Purish Dwivedi

      I am loading data from Access table into GridView, but it shows nothing in my Web Application after executing. What is wrong int this code?Plz help. This is my connection code. private void Binding() { // create the connection OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:/GmoteDeviceControl/App_Data/DeviceCtrl.mdb;User Id=admin;Password=;"); // Open the connection con.Open(); // create the DataSet DataSet ds = new DataSet(); // create the adapter and fill the DataSet OleDbDataAdapter da = new OleDbDataAdapter("Select * from SUBSCRIBER_DEVICES", con); da.Fill(ds); GridView1.DataSource = ds.Tables[0]; GridView1.DataBind(); // close the connection con.Close(); }

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Put a breakpoint to the line

      Purish Dwivedi wrote:

      da.Fill(ds);

      and see if ds.Tables[0] is filled with data properly or not.

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Microsoft Bing MAP using Javascript
      CLR objects in SQL Server 2005
      Uncommon C# Keywords
      /xml>

      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