Jacob Bahula

Jacob Bahula

  • NA
  • 12
  • 16.5k

populate dataset using classes

Aug 3 2006 6:53 AM
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;

}

Answers (1)