3
Reply

Which method do you invoke on the DataAdapter control to load your generated dataset with data?

sanjeev singh

sanjeev singh

15y
13.3k
0
Reply

    DataAdapter: DataAdapter is Nothing but It is Bridge B/w the dataset and Database.
    Befor going to dataadapter we need to follwing ;
    1)Establish the Connection to database
    2)Open Connection by Using Open method.
    3)Fill the Dataadapetr.
    Dataadpter load Genereated datd from Dataset Bu Using Fill() Method.
    Ex:
    Dataset ds = new Dataset();
    datataadpter da = new Dataadapter("Select Query",Con);
    da.Fill("Tablename",ds);
    da.Fill(ds);//like

    To load data in your dataset or datatable, you use "Fill" method which has different overloads such as:

    Fill(DataSet dsObject)    &&     Fill(DataTable dtObject)

    Example:

    SqlDataAdapter _adapter = new SqlDataAdapter();

    DataSet ds = new DataSet();

    //DataTable dt = new DataTable(); 

    _adapter.Fill(ds);

    //_adapter.Fill(dt);

    To load data in your dataset or datatable, you use "Fill" method which has different overrides such as:

    Fille(DataSet dsObject)    &&     Fill(DataTable dtObject)

    Example:

    SqlDataAdapter _adapter = new SqlDataAdapter();

    DataSet ds = new DataSet();

    //DataTable dt = new DataTable(); 

    _adapter.Fill(ds);

    //_adapter.Fill(dt);