Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 18th, 2004, 03:27 PM
Registered User
Join Date: May 2004
Location: , , .
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…

Reply With Quote
  #2 (permalink)  
Old May 18th, 2004, 03:55 PM
Friend of Wrox
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


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 "))


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

Something like that,

Reply With Quote
  #3 (permalink)  
Old May 18th, 2004, 11:29 PM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik

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

Hovik Melkomian.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 09:38 AM.

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