Hi Guys,
I have a problem which I hope you can help me solve. How do I display my database data in a tree view. Here is the scenarion.
I have table called locations that I want to display the location in a hierarchy manner e.g state, cities, counties going down. Eg If I have a state like Ohio it display all the related cities, if I select a city the town in that city should be displayed. My SQL table has 4 fields id, parentid, name, location code.
id=sql identity that autoincreases
parentId=should refer to the top level location eg a location with parentId 0 represents all the states,
name=its the actual name of the location
code=this is the code of the location.
The SQL Table is as follows.
CREATE TABLE [dbo].[Locations](
[id] [int] IDENTITY(1,1) NOT NULL,
[parentId] [int] NOT NULL,
[name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
I have a problem which I hope you can help me solve. How do I display my database data in a tree view. Here is the scenarion.
I have table called locations that I want to display the location in a hierarchy manner e.g state, cities, counties going down. Eg If I have a state like Ohio it display all the related cities, if I select a city the town in that city should be displayed. My SQL table has 4 fields id, parentid, name, location code.
id=sql identity that autoincreases
parentId=should refer to the top level location eg a location with parentId 0 represents all the states,
name=its the actual name of the location
code=this is the code of the location.
The SQL Table is as follows.
CREATE TABLE [dbo].[Locations](
[id] [int] IDENTITY(1,1) NOT NULL,
[parentId] [int] NOT NULL,
[name] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
VB.NET:
[nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_Locations] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
So if there is VB.Net form that can be able to display this hierarchy and display the selected location using a message box I will be grateful