473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Change Property Dinamically

I got a table with for example 10 fields, field001, field002 ...field010

what i want is do something like this

For i As Integer = 1 To 10
(table.field00 & i).value = "XX"
Next i

any ideas??
Jun 27 '08 #1
5 1057
srcp.

What do you mean with a table is that something to eat from.

As it is a datarow then it is simple

for i = 0 to 9
datarow.item(i) = "XX"
next

Assumming all fields are strings

Giving some more information mostly give better answers.

Cor

"srcp" <se******@intelnett.comschreef in bericht
news:eh**************@TK2MSFTNGP05.phx.gbl...
>I got a table with for example 10 fields, field001, field002 ...field010

what i want is do something like this

For i As Integer = 1 To 10
(table.field00 & i).value = "XX"
Next i

any ideas??
Jun 27 '08 #2
On Jun 25, 10:51*pm, "srcp" <sergi...@intelnett.comwrote:
I got a table with for example 10 fields, field001, field002 ...field010

what i want is do something like this

For i As Integer = 1 To 10
* * * * *(table.field00 & i).value = "XX"
Next i

any ideas??
I'm not really sure what you're trying to accomplish here, but if it's
what I think than you need to read up on Reflection,
Type.GetProperties, PropertyInfo, and PropertyInfo.SetValue.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jun 27 '08 #3
srcp wrote:
I got a table with for example 10 fields, field001, field002 ...field010
what i want is do something like this
For i As Integer = 1 To 10
(table.field00 & i).value = "XX"
If we're talking DataTables here, then they don't have Fields; DataRows
/within/ a Datatable do. In that case, you could so something like this:

Dim dr as DataRow = ...

For i As Integer = 1 To 10

Dim sFieldName as String _
= String.Format( "Field{0:000}", i )

dr.Item( sFieldName ) = "XX"
Next

HTH,
Phill W.
Jun 27 '08 #4
Thanks Cor, being more acurate in what i'm trying to do:

' Create a proxy from SAP
Public Proxy As new SAPProxy(dtSap.ConnectionString)

Dim myR3Table as New ZtestTable

Proxy.Connection.Open()

'I've already importe a function that fill a table defined in SAP

Proxy.zhr_rfc_fillTable(myR3Table)

By doing this i fill the table myR3Table, this is only a structure defined
in SAP system.

Thanks for your Help.

Sergio.

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:11**********************************@microsof t.com...
srcp.

What do you mean with a table is that something to eat from.

As it is a datarow then it is simple

for i = 0 to 9
datarow.item(i) = "XX"
next

Assumming all fields are strings

Giving some more information mostly give better answers.

Cor

"srcp" <se******@intelnett.comschreef in bericht
news:eh**************@TK2MSFTNGP05.phx.gbl...
>>I got a table with for example 10 fields, field001, field002 ...field010

what i want is do something like this

For i As Integer = 1 To 10
(table.field00 & i).value = "XX"
Next i

any ideas??

Jun 27 '08 #5
Thanks Seth, what i'm trying to do is changing a property for a set of
objects (in this case a row of a sap r3 table, but it can be a textbox,
button, etc) but doing it in just one line, i mean creating the name of the
object in runtime.
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:bc**********************************@f36g2000 hsa.googlegroups.com...
On Jun 25, 10:51 pm, "srcp" <sergi...@intelnett.comwrote:
I got a table with for example 10 fields, field001, field002 ...field010

what i want is do something like this

For i As Integer = 1 To 10
(table.field00 & i).value = "XX"
Next i

any ideas??
I'm not really sure what you're trying to accomplish here, but if it's
what I think than you need to read up on Reflection,
Type.GetProperties, PropertyInfo, and PropertyInfo.SetValue.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Daniel | last post by:
Hello!!! I'm creating controls dinamically in ASP.NET using VB. The problem is that i don't know how to catch the event of each button that i've create (the buttons are created dinamically). ...
2
by: Marco | last post by:
How I can create TextBox dinamically. I have to create 10 textbox dinamically which name will be txtBox_01, txtBox_02, etc... Thanks.
1
by: craigkenisston | last post by:
I have a project, in which in my default.aspx page, I dinamically load a user control in codebehind, in the pageload, that manages the website : Control objPageSkin = null; HtmlForm objForm =...
2
by: Fabio Cavassini | last post by:
I have this code that load HTML tags (no including <html> or <body>) into a DIV dinamically... after correctly retrieving the HTML, I assign it to my DIV Container ...
4
by: Cesar Ronchese | last post by:
Hello. I have a WebForm that contains a Panel object. This panel, at design time is empty. When running, I need to create dinamically a Label and a WebControl (built from the same project). I...
4
by: Fabio Cavassini | last post by:
I want to implement a good Persistent State checking feature, this feature should show the user the Save button only when there are changes to save, if there are no changes, the button will be...
32
by: Mateo | last post by:
I have char *array and it is dinamically alocated.... When I pass it to other function, I need to determine size of this array.... Problem: sizeof operator does not work with dinamically alocated...
0
by: Andrea | last post by:
I've built my own webcontrol to make page navigation. One of control's property is recordCount that is used to know how many record should be take in mind to print out the pages number. The...
3
by: valerio | last post by:
Hello all I would like to dinamically allocate an array of array of structures. To explain this: struct file{ char* fileName,int inode) myfiles; struct file{ char* fileName,int inode) mydirs; ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.