Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Tables in VB.NET (Read 1503 times)
Noelty
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Apr 14th, 2007
Tables in VB.NET
Apr 14th, 2007 at 4:30pm
Print Post  
Hello,

I just downloaded the Flowchart .Net component, and was trying out the sample program on Tables in Visual Basic .Net.

I was able to establish a relationship with tables by executing the following statement, after first creating the tables using fc.creattable statement.

       firsttable.AddRelation(0, Relationship.OneToMany, secondtable, 0)

If I now need to access this relationship information, how do I do that? I tried displaying the information about the arrow, but was giving an error that index cannot be negative.

    MsgBox(firsttable.IncomingArrows.GetAt(0).Text)

The Help which came with the software does not give any example...

Any help is much appreciated.

Thanks
Noel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tables in VB.NET
Reply #1 - Apr 16th, 2007 at 6:05am
Print Post  
Hello Noel,

Try that with firsttable.Rows.GetAt(0).IncomingArrows.GetAt(0).Text.

There are two ways in which FlowChart.NET lets you link Table nodes. The first is by their rows, e.g. a database diagram where a field in one table is related to a field in another table. In that case you must use the Incoming/Outgoing arrows collections of the specific table rows in order to access the arrows.

The second method ignores rows and considers tables to be integral entities - e.g. a class diagram where you don't need to relate members of a class to members of another class, but only show the inheritance hierarchy. In that case use the arrows collections of the Table objects.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Noelty
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Apr 14th, 2007
Re: Tables in VB.NET
Reply #2 - Apr 16th, 2007 at 6:20pm
Print Post  
Hi Stoyo,

I tried the following that you suggested, but it displays a blank text. 

"firsttable.Rows.GetAt(0).IncomingArrows.GetAt(0).Text."

Basically I want to simply create a relation between two tables and be able to display which table is referenced to which other table (their fields).

If you have any other suggestion, that would be helpful.

Thanks
Noel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Tables in VB.NET
Reply #3 - Apr 17th, 2007 at 5:26am
Print Post  
Hello Noel,

The code above returns the Text of an arrow. Do you need to display the text of the related fields? If the field labels are displayed in the first column, you can access them like this

Code
Select All
Dim relation as Arrow = firsttable.AddRelation(0, Relationship.OneToMany, secondtable, 0)
Dim t1 As Table = relation.Origin
Dim t2 As Table = relation.Destination
MessageBox.Show(t1(0, relation.OrgnIndex).Text)
MessageBox.Show(t2(0, relation.DestIndex).Text)
 



Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint