Populate dataset
-
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; }
-
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; }
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