Editing Rows

G

Guest

Yellow to al

I’m trying to do edit a row of a datatable

Dim dataTable As New DataTable("Vencimento"

I create four columns

Dim colWork As New DataColumn("ABONO", GetType(String)
colWork.Caption = "Abono
dataTable.Columns.Add(colWork

colWork = New DataColumn("VALORAB", GetType(String)
colWork.Caption = "Valor
dataTable.Columns.Add(colWork

colWork = New DataColumn("DESCONTO", GetType(String)
colWork.Caption = "Desconto
dataTable.Columns.Add(colWork

colWork = New DataColumn("VALORDES", GetType(String)
colWork.Caption = "Valor
dataTable.Columns.Add(colWork

Them I populate the first tow columns with a For, like this

For I as string = 1 To
row = dataTable.NewRow(
row("ABONO") = "Ret. Efectiva
row("VALORAB") = "10,00
dataTable.Rows.Add(row
Nex

This code create three equal lines, and the columns “DESCONTO†and “VALORDES†have the null expressio

What I want to do now is, fill the columns “DESCONTO†and “VALORDESâ€
With “IRS†and “5,00†strings

The out put must be like thi

Abono Valor Desconto Valo
Ret. Efectiva 10,00 IRS 5,0
Ret. Efectiva 10,00 IRS 5,0
Ret. Efectiva 10,00 IRS 5,0

There’s any one how can help me

Thank

Ana Rita
 
M

Miha Markic

Hi Ana,
Ana Rita said:
Yellow to all

I'm trying to do edit a row of a datatable.

Dim dataTable As New DataTable("Vencimento")

I create four columns.

Dim colWork As New DataColumn("ABONO", GetType(String))
colWork.Caption = "Abono"
dataTable.Columns.Add(colWork)

colWork = New DataColumn("VALORAB", GetType(String))
colWork.Caption = "Valor"
dataTable.Columns.Add(colWork)

colWork = New DataColumn("DESCONTO", GetType(String))
colWork.Caption = "Desconto"
dataTable.Columns.Add(colWork)

colWork = New DataColumn("VALORDES", GetType(String))
colWork.Caption = "Valor"
dataTable.Columns.Add(colWork)

Them I populate the first tow columns with a For, like this:

For I as string = 1 To 3
row = dataTable.NewRow()
row("ABONO") = "Ret. Efectiva"
row("VALORAB") = "10,00"
dataTable.Rows.Add(row)
Next

This code create three equal lines, and the columns "DESCONTO" and
"VALORDES" have the null expression
What I want to do now is, fill the columns "DESCONTO" and "VALORDES"
With "IRS" and "5,00" strings.

The out put must be like this

Abono Valor Desconto Valor
Ret. Efectiva 10,00 IRS 5,00
Ret. Efectiva 10,00 IRS 5,00
Ret. Efectiva 10,00 IRS 5,00

There's any one how can help me?

Dim dr as DataRow
For Each dr in dataTable.Rows
dr("DESCONTO") = "IRS"
dr("VALORDES") = "5,00"
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top