Topic: what would be the cfm of the below:


gavy    -- 01-08-2008 @ 2:19 PM
  hi friends, what could be the generic cfm code of this, i tried but not working

Dim Myvar as String
Dim MySQL as string = "Select email from yourTableName"
Dim MyConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("UrAppString"))
Dim objDR as SQLDataReader
Dim Cmd as New SQLCommand(MySQL, MyConn)
MyConn.Open()
objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
MyVar=""
While objDR.Read()
     MyVar+=objDR("email")& ";"
End While
MyVar=MyVar.substring(0,(MyVar.Length-1))

Regards and Thanks

<< << ArrowHead >> >>

<cf_bitterhead>
......Come and growl......
</cf_bitterhead>


CJ    -- 01-08-2008 @ 3:34 PM
 
quote:

i tried but not working


you tried what and it's not working how?

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

Teachers open the door. You enter by yourself.
—Chinese Proverb


louissto56    -- 01-08-2008 @ 4:14 PM
  Geez CJ, you seem to attract the "its not working" quote extremely often.

<cfquery name="myq">
SELECT email
FROM urTable
</cfquery>
<cfset myVar = "">
<cfloop query="myq">
myVar = mayVar & email & ";"
</cfloop>
<cfset myVar = mid(myVar,len(myVar)-1)>

Something along those lines if I can understand what you are doing.

____________________________
My Biz List.com.au :: Feb 08


EasyCFM.COM ColdFusion Forums : http://archive.easycfm.com/forums
Topic: http://archive.easycfm.com/forums/viewmessages.cfm?Forum=23&Topic=12940