473,654 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET equivalent to CFQUERY GROUP

Hey everyone,

I'm trying to find the best non-spaghetti code way to do the
equivalent of a ColdFusion CFQUERY GROUP command so that I can display
a FAQ with categories as follows:

-- Example: Begin --
General
- What is Enlighten?

Client Profile
- How do I add a new client?
- How do I update a client profile?

Programs & Activities
- How do I setup a new program?
- How do I add an activity to a program?
-- Example: End --

Any ideas? Please email me back at br***@mondoux.c om

Thanks.

Brent
Nov 18 '05 #1
1 1753
Found a solution to this, used a couple of queries to do the trick

<!-- #INCLUDE Virtual="../includes/header.aspx" -->
<!-- #INCLUDE Virtual="../includes/bofaq.aspx" -->

<script language="vb" runat="server">

Dim myFAQ As New boFAQ
Dim dstFAQCats As DataSet
Dim dstFAQs As DataSet
Dim dvwFAQs As DataView

Sub Page_Load
' Setup client object datasource
myFAQ.DSN = ConfigurationSe ttings.AppSetti ngs("enlightenD SN")

' In the event of a new FAQ item, place message on page
If Not Request.QuerySt ring("isnew") Is Nothing Then
lblStatusFAQ.Te xt = "FAQ item saved."
End If

If Not Page.IsPostBack Then
BuildList()
End If
End Sub

Sub BuildList()
dstFAQCats = myFAQ.getFAQCat egoriesWithItem s()
dstFAQs = myFAQ.getFAQSum mary()
dvwFAQs = dstFAQs.Tables( "tblFAQItem").D efaultView()

rptFAQs.DataSou rce = dstFAQCats
rptFAQs.DataMem ber = "tblFAQCategory "
rptFAQs.DataBin d()
End Sub

Function FilterFAQs(intC atID As Integer) As DataView
dvwFAQs.RowFilt er = "faqcategory_id =" & intCatID
Return dvwFAQs
End Function

</script>

<asp:label id="lblStatusFA Q" runat="server" Text="" />

<p><strong>Freq uently Asked Questions</strong></p>

<asp:Repeater ID="rptFAQs" RunAt="server">
<ItemTemplate >
<p><strong><% # Container.DataI tem("category_n ame") %></strong>
<asp:DataGrid Width="500" BorderWidth="0" CellPadding="3"
CellSpacing="0"
ShowHeader="Fal se" HeaderStyle-BackColor="#F6F 6F6"
AlternatingItem Style-BackColor="Alic eBlue"
AutoGenerateCol umns="False" DataKeyField="f aqitem_id"
DataSource='<%# FilterFAQs(
Container.DataI tem("faqcategor y_id") ) %>' runat="server">
<Columns>
<asp:BoundColum n Visible="False" HeaderText=""
DataField="faqi tem_id" SortExpression= "faqitem_id " />
<asp:HyperLinkC olumn DataTextField=" summary"
DataNavigateUrl Field="faqitem_ id"
DataNavigateUrl FormatString=". ./caseworker/faqitem.aspx?fi d={0}"
ItemStyle-Width="500px" HeaderText="Ite m" />
</Columns>
</asp:DataGrid></p>
</ItemTemplate>
</asp:Repeater>

On Wed, 23 Jun 2004 13:30:48 -0400, Brent Mondoux <br***@mondoux. com>
wrote:
Hey everyone,

I'm trying to find the best non-spaghetti code way to do the
equivalent of a ColdFusion CFQUERY GROUP command so that I can display
a FAQ with categories as follows:

-- Example: Begin --
General
- What is Enlighten?

Client Profile
- How do I add a new client?
- How do I update a client profile?

Programs & Activities
- How do I setup a new program?
- How do I add an activity to a program?
-- Example: End --

Any ideas? Please email me back at br***@mondoux.c om

Thanks.

Brent


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3786
by: Vannela | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different presentation styles and different data sources. Presentation styles like tabular format , graph format, grid format, freeform format, Composite format(somthing
9
17769
by: Paul Brownjohn | last post by:
Hello I am new both to this group and to C# programming having spent the last 15 years or so writing C and VB. You will forgive I hope if I am asking the totally obvious but it is a question that I cannot find an answer to in the doc: Is there an equivalent in C# to the "With Me" syntax in VB; specifically some means of getting a down-down that enumerates the objects available on a
2
3500
by: Sunkam Santhoshi | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different presentation styles and different data sources. Presentation styles like tabular format , graph format, grid format, freeform format, Composite format(somthing
5
6539
by: lcw1964 | last post by:
Greetings again, I will burden the group with yet another tenderfoot question, but since conscientious googling hasn't yield a lucid answer I thought I would risk the shortcut of asking here since I am so very keen to learn to code in standard C. Could someone tell me the long double equivalent of atof()? I was getting some peculiar behaviour in a little bit of math code I am working with. I thought the problem was in the math...
9
33070
by: AzenAlex | last post by:
Does anyone know what the C# equivalent of System.currentTimeMillis() would be?
35
19458
by: lnatz | last post by:
Hi, Is there an equivalent to the perl command chomp in C? And if there is no exact equivalent command, how would I go about removing the "\n" at the end of a stdin? Thank you, Natalie
1
2903
by: ploya | last post by:
Here's my code: <cfparam name="FORM.login" default="1"> <cfquery name="Recordset1" datasource="userLogin2"> SELECT welcome FROM Book1 WHERE user_name = <cfqueryparam value="#FORM.login#" cfsqltype="cf_sql_varchar" maxlength="255"> </cfquery>
2
3628
by: joshMcwatters | last post by:
Hi, I'm trying us mySql user defined variables in a cfquery tag, but I keep getting an error. I know the statement should work because I've tested it a mySQL GUI without problems. Coldfusion is taking issue with the SET @var=0; part of my statement. Here is the statement in full; SET @pos=0;
109
12761
by: bonneylake | last post by:
Hey Everyone, Well i am having a problem outputting for my report and hoping someone can explain what i am doing wrong. What the report is about is comparing my company's part price's to d and h, synnex and techdata. What i was told to do was take are part numbers and combine them with d and h, synnex and techdata to display only one column of parts (did this). Then i was told to create a cfloop using the query i created to combine the...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.