Fill up a dataset

  • Thread starter Thread starter Hugo Lefèvre
  • Start date Start date
H

Hugo Lefèvre

hello,
I want to fill up a dataset with data of my own. Which is the way to do this
?

///this is the creation of a dataset with a row which contains 2 fields

VerenigingDataSet VrDs = new VerenigingDataSet();

///if I do this, I receive an error

VrDs.Vereniging.Rows[0].ToString() = cbo1.Text;

VrDs.Vereniging.Rows[1].ToString() = txt1.Text;



How can I fill up this dataset with mine input data ?

Anyway many thanks and many regards,



Hugo
 
hi
try this
myDataRow = VrDs.Tables[0].NewRow();
myDataRow[0] = cbo1.Text;
myDataRow[1] = txt1.Text;
VrDs.Tables[0].Add(myDataRow);


regards
Ansil
Dimensions
Technopark
Trivandrum
(e-mail address removed)
 
Dear,

I am sorry, but what you have given as answer, do not work : it gives as
error : Cannot find table 0.

Can you tell me why ?

Many thanks and many regards,

Hugo


Ansil MCAD said:
hi
try this
myDataRow = VrDs.Tables[0].NewRow();
myDataRow[0] = cbo1.Text;
myDataRow[1] = txt1.Text;
VrDs.Tables[0].Add(myDataRow);


regards
Ansil
Dimensions
Technopark
Trivandrum
(e-mail address removed)

Hugo Lefèvre said:
hello,
I want to fill up a dataset with data of my own. Which is the way to do this
?

///this is the creation of a dataset with a row which contains 2 fields

VerenigingDataSet VrDs = new VerenigingDataSet();

///if I do this, I receive an error

VrDs.Vereniging.Rows[0].ToString() = cbo1.Text;

VrDs.Vereniging.Rows[1].ToString() = txt1.Text;



How can I fill up this dataset with mine input data ?

Anyway many thanks and many regards,



Hugo
 
Back
Top