Is it possible to pass a DataSet TableName as a parameter?

G

G

Is it possible to pass a DataSet TableName as a parameter? For
instance say I have the following code which I would like to repeat
for table1 --> table9. :

For i = 0 To DS.table1.Rows.Count - 1

Response.Write("<BR><BR><b>" & DS.table1.ToString & " Row " &
i.ToString & "</b>")
Response.Write("<BR> ID: " & DS.table1(i).ID)
Response.Write("<BR> Beg: " & DS.table1(i).BEG)
Response.Write("<BR> End: " & DS.table1(i).END)
Response.Write("<BR> Top: " & DS.table1(i).TOP)
Response.Write("<BR> Bot: " & DS.table1(i).BOT)

Next

Thanks,

Grey
 
G

G

OK, so I tried to do as you said, I created tablemappings, but I'm not
sure how to access them:

e.g.

//I created a number of tables based on the rows in my masterList
table
For i = 0 To DS.tblMasterList.Rows.Count - 1
strTableHtmlDS = Left$(DS.tblMasterList(i).html_filename)

strSQL = "SELECT * mytable WHERE ((EXPORT_id = " & i + 1 & ")) "
Oracleadapter.SelectCommand = New
System.Data.OracleClient.OracleCommand(strSQL, conn)

//OK using the same name for Source and Dataset table OK?
//e.g. …Add("table1", "table1")
Oracleadapter.TableMappings.Add(strTableHtmlDS, strTableHtmlDS)
Oracleadapter.Fill(Me.DS)

Next


//So Now I want to extract individuals columns of data
//Same loop as above loop through each table
For i = 0 To DS.tblMasterList.Rows.Count – 1
// Now want to loop through all the rows and display data
For j = 0 To DS.Tables(tblMasterList.i.tostring).Rows.Count – 1

//OK I'm confused here, what do I put in such that it is
parameterized?

Response.Write("<BR> ID: " & DS.table1(i).ID)

Response.Write("<BR> ID: " & DS.table1(i).ID)
Response.Write("<BR> Beg: " & DS.table1(i).BEG)
Response.Write("<BR> End: " & DS.table1(i).END)
Response.Write("<BR> Top: " & DS.table1(i).TOP)
Response.Write("<BR> Bot: " & DS.table1(i).BOT)

Next

Next


Thanks, for the help

Grey
 

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