0

anyone can help me with this problem to make coding about :

example question :

me got 1 table with item X,1,2,3
and other table with item Z and value at row 1,2,3
i want make 1st table item 1,2,3 got a same value at other one table at row value 1,2,3

example coding :
xx.text=xx1.text

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by ggl0rd
0
'Replace Nothing with an actual table. Get the table from the database through a dataset or something
        Dim tableX As DataTable = Nothing
        Dim tableY As DataTable = Nothing

       'This code assumes that tableX has N number of columns/1 row and tableY has at least 1 column
        For Each column As DataColumn In tableX.Columns
            Dim newRow As DataRow = tableY.NewRow()

            newRow(0) = tableX.Rows(0)(column)
            
            tableY.Rows.Add(newRow)
        Next

        'If you already have the same number of rows in tableY as the number of columns in tableX then use this
        Dim index As Integer = 0

        For Each column As DataColumn In tableX.Columns
            tableY.Rows(index)(0) = tableX.Rows(0)(column)

            index += 1
        Next
0

i still can't get it..
i try do like this..
but i dunno the coding.

example :
ds.tables("Name").Rows(2)=ds.tables("Job").item("1")

*sory i also dunno how to explain more details.

0

Sorry I don't understand what you are saying. Can you attach the database with the two tables here? I'll give you the code written for that.

0

The data in the two tables does not seem to have any kind of relationship with each other. Can you change the data(rows/values) so it looks like TableY has values from TableX and reupload the database?

This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.