Wrox Programmer Forums
|
BOOK: Professional Crystal Reports for VS.NET
This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2004, 03:27 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamically Changing SQL Commands?

I have developed an ASP.NET application that uses an “SQL Command” as described in the section “Working with SQL Commands" on page 181. I need to be able to change that command programmatically at runtime but I can’t find a way to do it. The change I would make would be to the WHERE clause, and the resulting table would have the same format as that specified in the report designer. Is there a way to alter the SQL Command programmatically, on the fly, at runtime?

Thank you…

Jerry
 
Old May 18th, 2004, 03:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Sure you can dynamically build a command. It sounds like you're creating dynamic SQL though; so none of the SQL queries can be predefined in advanced? If not, you can use string manipulation or regular expressions to parse apart the SQL string.

strSQL = strSQL.Substring(0, strSQL.indexOf(" WHERE "))

OR

' \. means any characters, and the + means one or more
strSQL = Regex.Replace(strSQL, " WHERE \.+", "")

Something like that,

Brian
 
Old May 18th, 2004, 11:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

u just make a string as a command & run set to a command Obj, this will be ur dynamic Command! So simple.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Logo on Datarepot Dynamically Solux VB Databases Basics 0 September 2nd, 2008 09:51 AM
changing drop down menu value dynamically elladi Javascript How-To 3 October 30th, 2007 12:01 PM
dynamically changing css sarah lee ASP.NET 2.0 Basics 0 January 25th, 2007 10:06 AM
dynamically changing CSS sarah lee CSS Cascading Style Sheets 1 January 25th, 2007 06:14 AM
dynamically changing the destination table premaanand SQL Server DTS 1 April 10th, 2006 03:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.