Visual Web Developer 05 User input Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbatestblrock
    New Member
    • Sep 2007
    • 164

    Visual Web Developer 05 User input Query

    Hi there,I dont even know if this is something that anyone will answer on here but I thought Id give her a shot!

    I am super new to VWD, and I am in desperate need of some assistance. I have searched google for hours to no avail, and I dont know where else to look. I think part of my problem is I dont even know what the correct terminology is to be used for what I am looking for.

    Here my scenario:
    I have a very large sql database that needs to be queried by a few different people on a weekly basis. I am new to using VWD 2005 but I feel I can grasp it quite well through tutorials, etc so forgive if me if my terminology is off. I can setup my own queries on this database and run them fine, but the problem is that the people that need to access this DB will want different queries run all the time. EX- 'check sales from store XX from this date to this date' another ex: 'check sales from stores x,x,x,x,x,x,x,x from this date to this date' another example: 'check amount of coupons used from all stored on this date'

    The list could go on.. So I was thinking to create a form for them to easily set the query parameters So I would have some text boxes, maybe some radio buttons, and check boxes and those would be the parameters for the query once the submit button is hit.

    Now I dont expect anyone to hold my hand through this, but I was just wondering if someone could possibly tell me A- what this process is technically called, B- point toward any page that maybe has a tutorial on such a process, and C- any information you feel would I would benefit from.


    Thank you so much for any of your time, and have a great day!!!
  • jeffstl
    Recognized Expert Contributor
    • Feb 2008
    • 432

    #2
    I have yet to use Microsofts new tool you are referring too. I know what it is I think though.

    You will likely need to do your coding in VB.NET and ASP.NET to create a form, and process the parameters and send them to your SQL querys.

    You will need to manipulate the data by triggering code on certain events of the controls.

    Comment

    • mbatestblrock
      New Member
      • Sep 2007
      • 164

      #3
      Originally posted by jeffstl
      I have yet to use Microsofts new tool you are referring too. I know what it is I think though.

      You will likely need to do your coding in VB.NET and ASP.NET to create a form, and process the parameters and send them to your SQL querys.

      You will need to manipulate the data by triggering code on certain events of the controls.
      Good deal, off to a good start. The form is not a problem, of course.. its making manipulate the query data I am having problems with. I thought it would be something kind of simple while setting up the query in VWD but I don;t see too much on how to do it. I read somewhere in my tons of searching that setting the filter fort a certain field to "?" sans the quotes would mean that a user would have to input the query string for that field, but then did not explain further on how the user would pass that data to it... So I am still lost! and I am still searching online and still hoping for some pointers!

      Thanks!

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        If you are not worried about security too much, you can generate your SQL query string "on the fly" using simple string concatination based on user input.

        I would much rather suggest that you set some groundwork for the SQL queries. Sort of like "group" similar queries and restrict what they can and cannot do. Maybe that's not an options considering how broad a selection types you want.

        Seems like what you would like to create is a dynamic sql query creator. Doable, but not simple I wouldn't think.

        Your idea for textboxes/dropdowns/radio buttons/etc is probably on the right track.

        Comment

        • mbatestblrock
          New Member
          • Sep 2007
          • 164

          #5
          Originally posted by Plater
          Seems like what you would like to create is a dynamic sql query creator. Doable, but not simple I wouldn't think.

          Your idea for textboxes/dropdowns/radio buttons/etc is probably on the right track.
          Your exactly right. Is there a technical ASP.NET phrase you would call this, or a function in VWD that will make this happen for me. I am still digging around to try and find a solution.

          Thanks a million!

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            I don't think there is really either.
            What you want to do is actually pretty complex (depending on the amount of different things you want to allow users to do)

            Comment

            • mbatestblrock
              New Member
              • Sep 2007
              • 164

              #7
              Originally posted by Plater
              I don't think there is really either.
              What you want to do is actually pretty complex (depending on the amount of different things you want to allow users to do)

              ....
              If you are not worried about security too much, you can generate your SQL query string "on the fly" using simple string concatination based on user input.
              What about that? is that. Is it a fairly straight forward process?

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                Well, no. It will be a lot of "if <this> then <this> else <this>"
                I would suggest starting off with something simple-ish.
                Like allowing the user to specify which columns they want returned.
                Get that working, then start adding more pieces to the puzzle.
                You can look at Microsoft Access's query builder if you need ideas on things to implement.

                Comment

                • mbatestblrock
                  New Member
                  • Sep 2007
                  • 164

                  #9
                  Originally posted by Plater
                  Well, no. It will be a lot of "if <this> then <this> else <this>"
                  I would suggest starting off with something simple-ish.
                  Like allowing the user to specify which columns they want returned.
                  Get that working, then start adding more pieces to the puzzle.
                  You can look at Microsoft Access's query builder if you need ideas on things to implement.

                  So I have found this:
                  http://www.4guysfromro lla.com/webtech/102300-1.shtml

                  I think this is what I need? I have not read through it yet but at a glance it seems like what I need. Ill update if anything good comes of it!

                  Comment

                  • Plater
                    Recognized Expert Expert
                    • Apr 2007
                    • 7872

                    #10
                    It doesn't appear to offer anything I haven't already said. Stored procedures will help you with security, but the more generic you make them, the less secure they are.
                    Ideally you would have a handfull of specific stored procedures to run your tasks, but you said you really needed them to be super flexable to accomodate what your users want at the "given moment"

                    Comment

                    • mbatestblrock
                      New Member
                      • Sep 2007
                      • 164

                      #11
                      Originally posted by Plater
                      It doesn't appear to offer anything I haven't already said. Stored procedures will help you with security, but the more generic you make them, the less secure they are.
                      Ideally you would have a handfull of specific stored procedures to run your tasks, but you said you really needed them to be super flexable to accomodate what your users want at the "given moment"
                      Yes thats all correct. That does appear to be everything you said pretty much. I still haven't gotten around to try to implement this yet. But ill post with any updates if it happens to somewhat workout for me.

                      Comment

                      Working...