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. General Programming
  3. C#
  4. Populate dataset

Populate dataset

Scheduled Pinned Locked Moved C#
sysadminsecurityhelp
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.
  • M Offline
    M Offline
    Mamphekgo
    wrote on last edited by
    #1

    hi guys i am trying to populate dataset using classes but it gives me this error" Cannot create an instance of the abstract class or interface" and here is my code. public class DataAcces { public SqlConnection conn; //public SqlCommand cmdDisplay; public DataSet dsDisplay ; public DataAdapter daDisplay; private string ConString = "integrated security = SSPI;initial catalog = Phusa;server = za211149;persist security info = false"; public DataAcces() { // // TODO: Add constructor logic here // } public bool Connection() { try { conn = new SqlConnection(ConString); DataAdapter daDisplay = new DataAdapter("SELECT * FROM Customers",conn); dsDisplay = new DataSet(); daDisplay.Fill(dsDisplay); } catch(Exception ex) { MessageBox.Show(ex.Message); return false; } return true; }

    N 1 Reply Last reply
    0
    • M Mamphekgo

      hi guys i am trying to populate dataset using classes but it gives me this error" Cannot create an instance of the abstract class or interface" and here is my code. public class DataAcces { public SqlConnection conn; //public SqlCommand cmdDisplay; public DataSet dsDisplay ; public DataAdapter daDisplay; private string ConString = "integrated security = SSPI;initial catalog = Phusa;server = za211149;persist security info = false"; public DataAcces() { // // TODO: Add constructor logic here // } public bool Connection() { try { conn = new SqlConnection(ConString); DataAdapter daDisplay = new DataAdapter("SELECT * FROM Customers",conn); dsDisplay = new DataSet(); daDisplay.Fill(dsDisplay); } catch(Exception ex) { MessageBox.Show(ex.Message); return false; } return true; }

      N Offline
      N Offline
      NasimKaziS
      wrote on last edited by
      #2

      use this connection string Data Source = za211149; Initial Catalog = Phusa;User Id = userid; Password = password -- modified at 7:39 Thursday 3rd August, 2006

      where there is a will there is a way

      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