EasyCFM.COM ColdFusion Forums / ASP to CFML / what would be the cfm of the below:

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: what would be the cfm of the below:

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

gavy
01-08-2008 @ 2:19 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 72
Joined: Feb 2005

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
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

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
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1149
Joined: Jan 2007

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


Website Designed and Developed by Pablo Varando.