.BiOHaZaRD
New Member
I'm not quite sure how to approach this so thought it best to ask, see if anyone has any ideas that may help.I have a table stored in SQL Server that stores Exchange 2010 Mailbox Server Performance Data with this schema:\[code\]CREATE TABLE [dbo].[2010_Perfmon_MBX]( [ID] [int] IDENTITY(1,1) NOT NULL, [Server] [varchar](50) NULL, [ObjectName] [varchar](100) NULL, [CounterName] [varchar](100) NULL, [InstanceName] [varchar](100) NULL, [Value] [decimal](18, 3) NULL, [DateTime] [datetime] NULL)\[/code\]I also have an ASP.NET website written in C#. I want to allow users to select cascading answers, that ultimately returns the requested data into a GridView/Graph.Right now, my main challenge is how to ensure the data is not returned until the end user has selected values from all of the columns.I want to stage it like this:User is asked for a server to pull data from\[code\]SELECT DISTINCT(Server)FROM 2010_Perfmon_MBX\[/code\]Let's pretend they pick the server \[code\]MailboxServer.domain.com\[/code\]:\[code\]SELECT DISTINCT(ObjectName)FROM 2010_Perfmon_MBXWHERE Server = 'MailboxServer.domain.com'\[/code\]User is then asked, based on the server \[code\]MailboxServer.domain.com\[/code\], for an ObjectName. They pick \[code\]'msexchangeis mailbox'\[/code\] for example:\[code\]SELECT DISTINCT(CounterName)FROM 2010_Perfmon_MBXWHERE Server = 'MailboxServer.domain.com'AND ObjectName = 'msexchangeis mailbox'\[/code\]Next the user is asked for \[code\]CounterName\[/code\]. They pick \[code\]'active rpc threads'\[/code\]:\[code\]SELECT DISTINCT(InstanceName)FROM 2010_Perfmon_MBXWHERE Server = 'MailboxServer.domain.com'AND ObjectName = 'msexchangeis mailbox'AND CounterName = 'active rpc threads'\[/code\]Lastly they pick the \[code\]InstanceName\[/code\]. In this example \[code\]'Database20'\[/code\]. The full query then runs which pulls back all of the data based on the choices made:\[code\]SELECT *FROM 2010_Perfmon_MBXWHERE Server = 'MailboxServer.domain.com'AND ObjectName = 'msexchangeis mailbox'AND CounterName = 'active rpc threads'AND InstanceName = 'Database20'\[/code\]What is the most elegant way of ensuring that the flow of choices works without jumping ahead and chaining the selections?I need to ensure that the selections are dynamic, and is based on available data in the SQL Server table for the selected server, so only valid data can be chosen.Thanks for reading.