private void tbNuevo_Click(object sender, EventArgs e)
{
... connections up in the Load....
botones("NUEVO");
limpiar();
txtNombre.Focus();
oCC = new OleDbCommandBuilder(dtc);
DataSet dst= new DataSet();
dtc.Fill(dst, "contador");
iPosact = dst.Tables["contador"].Rows.Count - 1;
DataRow dtr = new DataRow();
dtr = dst.Rows.[iPosact]; //error in this line
vUltimo = dtr["regnum"]; // error in this line

}

I need to fill the vUltimo with the value of REGNUM in the last record of CONTADOR table. Can help me , please?

Recommended Answers

All 3 Replies

dtr = dst.Rows[iPosact]; No . between Rows and [.

You also don't need the new DataRow() part on the line above, you can combine the two lines into

DataRow dtr = dst.Rows[iPosact];

Thx.

DataRow dtr = dst. don't accept the word Rows after the dot and Intellisense don't have Rows after the dot. Rows word have the error red mark (Say Don't contain definiton of Rows....more...)

dst.Tables["contador"].Rows[blah] ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.