Click here to Skip to main content
15,908,274 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Same form opens every time Pin
Mycroft Holmes7-Dec-09 13:29
professionalMycroft Holmes7-Dec-09 13:29 
GeneralRe: Same form opens every time Pin
Ashfield7-Dec-09 21:00
Ashfield7-Dec-09 21:00 
Questionon successful login, close login screen and activate MDI screen Pin
S.Aijaz6-Dec-09 20:38
S.Aijaz6-Dec-09 20:38 
AnswerRe: on successful login, close login screen and activate MDI screen Pin
dan!sh 6-Dec-09 21:40
professional dan!sh 6-Dec-09 21:40 
AnswerRe: on successful login, close login screen and activate MDI screen Pin
Dave Kreskowiak7-Dec-09 6:20
mveDave Kreskowiak7-Dec-09 6:20 
QuestionIdentifying system process Pin
srikantha_nagaraj5-Dec-09 19:45
srikantha_nagaraj5-Dec-09 19:45 
AnswerRe: Identifying system process Pin
dan!sh 5-Dec-09 20:12
professional dan!sh 5-Dec-09 20:12 
QuestionTreeview Populate Parent/Child From Database with Multiple Tables Pin
lam115824-Dec-09 6:32
lam115824-Dec-09 6:32 
Hi, I am new at this so please go easy on me...;)

I am working on a treeview control in visual studio 2008 using visual basic. I am trying to populate the treeview with data from 2 sql database tables. I am able to populate the parent nodes but cannot populate the child nodes at this point. [Note: With my data, Parents are "Firms" which are stored in the Firm's table and Childs are "Funds" and are stored in the Funds table. The two tables are related using a FK with FirmID connecting the two tables].

My code to populate the parent node is as follows:

'populate the tree view control
TreeView1.Nodes.Clear()

Dim ParentRow As DataRow
Dim ParentTable As DataTable
ParentTable = FirmFundDataSet.Tables("RAInput_Firms")

For Each ParentRow In ParentTable.Rows
Dim ParentNode As TreeNode
ParentNode = New TreeNode(ParentRow.Item("FirmName"))
TreeView1.Nodes.Add(ParentNode)
Next

The ultimate goal of my project is to use the treeview as a way to navigate other forms in my project.

I have seen some examples on the web that show a solution were you relate the two datatables (e.g. dataset.Relations.Add(etc)) and then use some code like the following to add the child nodes. This does not work for me because I get an error that states that a relationship already exists between my tables (note: I added a relation in vb to tables that are related in sql, so this kind of makes sense. Not sure how to work with an existing dataset relationship though).

''''populate child'''''
Dim childrow As DataRow
Dim childnode As TreeNode
childnode = New TreeNode()
For Each childrow In parentrow.GetChildRows("FirmToFund")
childnode = parentnode.Nodes.Add(childrow(2))
Next childrow

Any help would be appreciated.
QuestionHelp provider+win Form Pin
Ramkumar_S2-Dec-09 20:13
Ramkumar_S2-Dec-09 20:13 
QuestionResizable Form Without FormBorderStyle (None) Pin
m_chopsquad1-Dec-09 13:07
m_chopsquad1-Dec-09 13:07 
AnswerRe: Resizable Form Without FormBorderStyle (None) Pin
Richard Blythe3-Dec-09 14:28
Richard Blythe3-Dec-09 14:28 
Questiondata grid view Pin
Ramkumar_S25-Nov-09 15:19
Ramkumar_S25-Nov-09 15:19 
AnswerRe: data grid view Pin
dan!sh 25-Nov-09 17:17
professional dan!sh 25-Nov-09 17:17 
AnswerRe: data grid view Pin
Mycroft Holmes5-Dec-09 23:39
professionalMycroft Holmes5-Dec-09 23:39 
QuestionAt The Risk Of Being Excoriated... Pin
Roger Wright24-Nov-09 19:38
professionalRoger Wright24-Nov-09 19:38 
AnswerRe: At The Risk Of Being Excoriated... Pin
Mycroft Holmes25-Nov-09 15:17
professionalMycroft Holmes25-Nov-09 15:17 
GeneralRe: At The Risk Of Being Excoriated... Pin
Roger Wright25-Nov-09 20:26
professionalRoger Wright25-Nov-09 20:26 
GeneralRe: At The Risk Of Being Excoriated... Pin
Mycroft Holmes25-Nov-09 20:58
professionalMycroft Holmes25-Nov-09 20:58 
AnswerRe: At The Risk Of Being Excoriated... Pin
darkelv30-Nov-09 22:17
darkelv30-Nov-09 22:17 
Questionproblem accessing remote database. Pin
S.Aijaz23-Nov-09 23:51
S.Aijaz23-Nov-09 23:51 
AnswerRe: problem accessing remote database. Pin
dan!sh 24-Nov-09 0:08
professional dan!sh 24-Nov-09 0:08 
AnswerRe: problem accessing remote database. Pin
Shameel24-Nov-09 2:15
professionalShameel24-Nov-09 2:15 
Questionresize form and controls according to Screen resolutions Pin
εїзεїзεїз22-Nov-09 21:03
εїзεїзεїз22-Nov-09 21:03 
AnswerRe: resize form and controls according to Screen resolutions Pin
Natza Mitzi22-Nov-09 21:36
Natza Mitzi22-Nov-09 21:36 
GeneralRe: resize form and controls according to Screen resolutions Pin
εїзεїзεїз22-Nov-09 21:47
εїзεїзεїз22-Nov-09 21:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.