Removing &&<Select A Value&&> Item From The Singlevalued Parameter Dropdown
Hello All,
I am developing reports using SQL Reporting Services 2005. These reports have some single valued parameters and these parameters will be provided in report viewer itself. These parameters should have "All" as default.
"Select All" comes by default in Multivalue report parameter. But for single value parameter it always shows "<Select a value>" and if the user does not select a value,it prompts for one.I need to remove <Select Value> and show "All" as default thereby user does not have to select a value.
I can include "All" as a part of the select query in the parameter's datasource so that it can be shown in the parameter dropdown . However, I am not sure how I can remove "<Select a value>" from the dropdown.
Does anyone have any pointers? Thanks in advance.
Ashish
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Dropdown - Multi-select Won't Show Values If Only One Item Is Available
I have a report that has 2 dropdowns, selecting from the first dropdown populates the second one. This works fine in the BI Studio. When I deploy this report to the 'Report Manager' and make a selection from the first dropdown, the second dropdown loads (as expected). I tried to select from the second dropdown (which has only 1 item - which is correct), the dropdown does not appear correctly - as in, I can't see that item. Since we can't attach anything here, below is the link to a screenshot of my issue: http://docs.google.com/View?docid=ddd6j2xn_52c5qd5 If you look closely at the screenshot from the link above, you'll see that there is a value in the second dropdown - it just won't show completely - as if the dropdown is not rendering correctly. I can view source on the page and see that the dropdown has a value. What appears to be happening is the if only 1 item is in the second dropdown and that item is longer than the size of the dropdown, the dropdown won't render. Here is my value for the second dropdown '012 Candy Gadler David Thapero'. This is the only value in the second dropdown. - You can try 35 chars or more in the dropdown to confirm. Notes: + No special chars are in either dropdown + I am using IE 7 (Also had someone test this on IE 6 - same problem) + Using Visual Studio 2005 to build report - where this works fine Work around: + If I add another item to the dropdown via a UNION query, I see the original value + the new item in the dropdown #2 Please share your thoughts Thanks, h.
View Replies !
View Related
Unable To Execute Stored Procedure When New Item Is Selected In Dropdown.
I'm using a form that has a dropdown control. This dropdown control has items that can be selected that serves as a filter for displaying results on the page that is returned from a stored procedure call. I'm having trouble finding a way to execute the stored procedure to display the filtered results everytime a different item in the dropdown gets selected. Currently, the form does get submitted and the selected item does get saved, but the stored procedure never gets executed on a postback. Any ideas on resolving this issure? Your help is much appreciated.
View Replies !
View Related
Parameter DropDown List Grayed-out
I am building a report with several search parameters; three of which are dropdown boxes each populated by a data set. I wanted something more user-friendly than the default "(Null)" in the dropdown, so for each data set, it returns a result set UNIONed with " N/A" to show up first as the default. For some reason, when the report loads, the first dropdown populates just fine and does indeed have the default value " N/A" but the other two dropdowns are grayed-out. Until you change the first dropdown (to anything, apparently it doesn't matter what you change it to) the other two stay grayed-out. When the first is changed, the other two are populated and default to the desired " N/A" default value. Why would it do this, when it didn't do it before; i.e. when the default for all of them was simply null. The dropdowns are not dependent on each other; they don't depend on other parameters for their values. Any help would be appreciated.
View Replies !
View Related
Adjusting Parameter Dropdown Width
Hi there, May be a kind of dumb question, but I have a multi-value parameter that I would like to give users the ability to select from in a SSRS 2005 Report and I was wondering if there was a way to adjust the width of the drop down so the user wouldn't have to scroll horizontally to see a full parameter item. It looks like it cuts off after about 30 characters. Any help here would be appreciated. Thanks! Rich
View Replies !
View Related
Report Viewer Parameter Dropdown Width
Does anyone know how to control the width of the parameter dropdownlist? If you select "Multi-value" for the parameter (non-sp1 version) the parameter list is in a dropdownlist that is manageable in size. If you do not use the multi-value parameter, it looks like the width of the dropdownlist is determined by the width of the longest text of the returned parameters. Is there any way to control the width of the dropdown? Thanks Rob
View Replies !
View Related
Multi-value Parameter Dropdown Horizontal Scrollbar Problem
Hi, I wonder if anyone ecountered (and successfully solved) the following problem: I have a query-based multi-valued parameter (let's call it "A"). When query that populates the parameter returns only one value and that value is a long text, then it's almost impossible to select this value through the Report Manager UI. It's because the horizontal scrollbar covers the value. For now I have found two workarounds to this problem: 1. Cut the lenght of the Parameter Label value (Instead of 'Large Power Transformer", I show "Large Power Tran...") 2. Make the label in the multi-value dropdown smaller by using custom style sheets for report manager. I added a "LABEL { font-size: 7pt; }" section to the Htmlviewer.css and modified the RSReportServer.config file to point to the Htmlviewer.css (for info on how to do this please see: http://msdn2.microsoft.com/en-us/library/ms345247.aspx) So far I am using the No 2. workaround. Any other suggestions on final solution to that matter would be highly appreciated.
View Replies !
View Related
Expanding The Multi-Valued Parameter Dropdown Menu
Hello Everyone, I am trying to expand the multi-valued parameter menu object so I can display the selection list in a more user-friendly format since the text is fairly long. If left at the default setting then I have to scroll to the right to see the complete string(s). For a single-select parameter I can just CAST the string to CHAR(100) and the menu object will expand. However, it seems that this approach is not working for multi-valued parameter menu objects. Is this a bug in SSRS, and is there another way to accomplish this. Please let me know. Thank You!!!
View Replies !
View Related
Multivalue Parameter Dropdown Not Working In Aspx Page
Hi All i have created one report using SSRS 2005, in this report one parameter is multivalue parameter, this report preview working fine and user able to select multivalues. but the problem is i deployed this report in server and opened in client system (reports shown to user using report viewer in aspx pages), i am able to access the report but multivalue parameter dropdown is not working. when i clicked on multivalue parameter dropdown report refreshing and remaining parameters default vaues coming up.. i am unable to find the solution please anyone help me thanks
View Replies !
View Related
Setting Dynamic Default Parameter In Dropdown Based On MDX Query
I have a parameter list that is built using an MDX query. I would like to set the default value to the current month. Here is the MDX used. Code Snippet WITH MEMBER [Measures].[ParameterCaption] AS '[Time].[Month].CURRENTMEMBER.MEMBER_CAPTION' MEMBER [Measures].[ParameterValue] AS '[Time].[Month].CURRENTMEMBER.UNIQUENAME' MEMBER [Measures].[ParameterLevel] AS '[Time].[Month].CURRENTMEMBER.LEVEL.ORDINAL' SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , [Time].[Month].ALLMEMBERS ON ROWS FROM ( SELECT ( STRTOSET(@TimeYear, CONSTRAINED) ) ON COLUMNS FROM [Pink Flag]) Any help would be appreciated. I have tried to set an expression to build a string that matches the result. Thanks Jason
View Replies !
View Related
DateTime Parameter, Calendar Control Turn Into A Combo Dropdown Selection
I have a very strange behaviour with a DateTime parameter in Reporting Services. I can type "=today()" as the default value in the report parameters and the calendar shows up as expected when I select preview. If I type either "=today()" in available values for my datetime parameter or connect a dataset that return only one record the calendar disappears and a combo dropdown appears. Are there any solutions to connect a dataset at still show the calendar control with a datetime parameter? Hope anybody can help me.
View Replies !
View Related
Select Statement For Dropdown List
I have a dropdown list that is populated by two columns in a database.select (firstname+surname) AS Fullname from table where id = 'id'; It works fine but i want to know how i would get a space between the firstname and the surname because at the moment all the values come back as JoeBloggs....without any spaces
View Replies !
View Related
Firefox In Mac Fails To Render Scrollbar In The Multi-value Parameter Dropdown List Generated By ReportViewer.
Our clients working with the Firefox browser on a Mac are unable to use the Multi-Value parameter drop down lists that the Report Viewer control generates. Of course I realize that the multi-select dropdown lists are not really dropdown option lists using the standard HTML select tag, but are rather tables within div tags with cells that contain spans, inputs, and labels. Originally the report viewer displayed these lists in the wrong position within Firefox on any platform (Mac or PC). Furthermore, there were other visibility problems with those lists that made it virtually impossible to select a checkbox within the list. Fortunately, Microsoft fixed this problem with the latest version of Report Viewer, which we downloaded from the following link: http://207.46.19.190/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&displaylang=en So currently we have SQL Reporting Services Report Viewer 9.0.21022.8 installed on our web server. And the dropdown lists do appear as expected, and they work properly in Firefox on a PC. But, when the control is rendered in Firefox on a Mac, the list is not scrollable. The scroll bar that should appear on the right-hand side of the dropdown list, which would enable users to select values toward the bottom of the list, does not appear. That scrollbar is missing in Firefox. This is likely related to a Firefox rendering issue with the overflow:auto style. There are numerous entries on the web that indicate Firefox for Mac has a problem with overflow:auto. For example: http://www.webdeveloper.com/forum/archive/index.php/t-96958.html http://www.daniweb.com/forums/thread44144.html http://iamthewalr.us/blog/2007/04/20/firefox-on-the-mac/#comment-2321 http://www.errorforum.com/mozilla-firefox-error/3503-will-float-mac-firefox-scrollbars-floating-pop-up-windows.html https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=187435 That being the case, it seems that there should be some workaround to address this, either via a style or through some alternate control. Or perhaps there is a property that we can apply to the ReportViewer control that I'm unaware of which addresses this. If you know of a workaround, or can suggest an alternate approach that we could implement quickly, please respond. Thanks.
View Replies !
View Related
SQL Parameter And Item Has Already Been Added. Key In Dictionary: Error
Hi there, I have a search page that redirects to another page transfering the search terms in a querystring. In the page to display the search results I use SQL parameters to show the results. Everything runs fine until I do a page refresh or use paging to bring up another set of results. Everytime I try to refresh/page etc. I get the following error: Item has already been added. Key in dictionary: "@CityTown" Key being added: "@CityTown" Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: "@CityTown" Key being added: "@CityTown" Source Error: Line 20: Line 21: 'Creates parameters for the WHERE statement taking the querystring contents from previous page Line 22: dsPropertyListing.Parameters.Add("@CityTown", CityTown) Line 23: dsPropertyListing.Parameters.Add("@Suburb", Suburb) Line 24: dsPropertyListing.Parameters.Add("@Rooms", Rooms) Source File: K:detailsdetailspropertylisting.aspx Line: 22 Stack Trace: [ArgumentException: Item has already been added. Key in dictionary: "@CityTown" Key being added: "@CityTown"] System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +931 System.Collections.Hashtable.Add(Object key, Object value) +11 ASP.detailspropertylisting_aspx.Page_Load(Object sender, EventArgs e) in K:detailsdetailspropertylisting.aspx:22 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +55 System.Web.UI.Control.LoadRecursive() +27 System.Web.UI.Page.ProcessRequestMain() +731 Any sugestions that anyone could provide would be greatly appreciated. This error obviously renders the search features useless. Thanks in anticipation, TCM
View Replies !
View Related
Can I Set Each Item In A Listbox As A Parameter When Updating Access Database?
Hello everyone. I am using C#, and posted this in the C# forum, but was told to try here, as for some reason I just can't get this to work. Everyone was very helpful, but for some reason I keep getting a message that a value is not being given for one or more required parameters. This doesn't make any sense though, as I am specifying a value for all parameters... Basically, I have a listBox that has several items in it. I want to update the database for each item that appears in the listBox. I can't seem to get this to work though, no matter what I try, and it is driving me nuts... lol Here is a link to my original thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2349891&SiteID=1 Here is my code: Code Block string whereClause = ""; for (int i = 0; i < Panel1ListView1.Items.Count; i++) { if (i == 0) { whereClause = "ID = " + Panel1ListView1.Items[0].Text; } else { whereClause += " OR ID = " + Panel1ListView1.Items[i].Text; } } try { using (OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Environment.CurrentDirectory + @"DB.mdb;Jet OLEDB:Database Password=xxx;")) { OleDbCommand cmd; conn.Open(); string command = "UPDATE [Table1] SET [Status] = @P1, [Name] = @P2, [Number] = @P3 WHERE " + whereClause; cmd = new OleDbCommand(command, conn); cmd.Parameters.Add("@P1", OleDbType.VarChar).Value = Panel1TextBox3.Text; cmd.Parameters.Add("@P2", OleDbType.VarChar).Value = Panel1TextBox1.Text; cmd.Parameters.Add("@P3", OleDbType.VarChar).Value = Panel1TextBox2.Text; int i = cmd.ExecuteNonQuery(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } I really appreciate any help anyone can give me. I REALLY want to get this working. I am open to any suggestions and will try anything. Thank you very much for your help.
View Replies !
View Related
Select .... Where The Item.ID Is In This Array?
Hiya,I want to populate a list view (in a variety of ways), but I would rathernot execute my function once for every record I want to show in the list.What I want to do is pass an array of "keys" into a stored procedure andhave that procedure return one recordset with all of the records in. Sowhat I want to do is something like:CREATE PROCEDURE MySuperProcedure@MyArrayOfIDs (some way of specifying an array of integers),ASSELECT *FROM MyTableWHERE MyArrayOfIDs.ContainsTheInteger ( MyTable.ID )Obviously this syntax is not available. Is there another way of doing this?
View Replies !
View Related
Subreports: Parameter Value Dropdown Shows Sum And Count Fields But Not The Actual Data Fields.
I have just started using SQL Server reporting services and am stuck with creating subreports. I have a added a sub report to the main report. When I right click on the sub report, go to properties -> Parameters, and click on the dropdown for Parameter Value, I see all Sum and Count fields but not the data fields. For example, In the dropdownlist for the Parameter value, I see Sum(Fields!TASK_ID.Value, "AppTest"), Count(Fields!TASK_NAME.Value, "CammpTest") but not Fields!TASK_NAME.Value, Fields!TASK_ID.Value which are the fields retrieved from the dataset assigned to the subreport. When I manually change the parameter value to Fields!TASK_ID.Value, and try to preview the report, I get Error: Subreport could not be shown. I have no idea what the underlying issue is but am guessing that it's because the field - Fields!TASK_ID.Value is not in the dropdown but am trying to link the main report and sub report with this field. Am I missing something here? Any help is appreciated. Thanks, Sirisha
View Replies !
View Related
Retrieving Only One Record Per Item Using A Select
The following select retrieves multiple reoords for each i.number. How can I select just the first record for each i.number? SELECT i.number, i.desc, i.it_sdate, v.entry_date FROM itemsnum as I INNER JOIN Inventor as V ON SUBSTR(i.number,1,5)=v.catalog WHERE v.entry_date<ctod("04/01/06") AND i.it_sdate < ctod("04/01/06") order by number, it_sdate desc Thanks in advance!
View Replies !
View Related
Select Most Recently Edited Item AND A Certain Type If Another Doesn't Exist
I've got a big problem that I'm trying to figure out:I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those.I don't need this for an individual ID select, I need it applied to every record from the table.My address table has some columns that look like: [AddressID] [int][LocationID] [int][Type] [nvarchar](10)[Address] [varchar](50)[City] [varchar](50)[State] [char](2)[Zip] [varchar](5)[AddDate] [datetime][EditDate] [datetime]AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table.So there will be multiple addresses to one LocationID, but each address will have it's own AddressID.How can I do this efficiently with perfomance in mind???Thank you in advance for any and all replies...
View Replies !
View Related
Select Most Recently Edited Item AND A Certain Type If Another Doesn't Exist
I've got a big problem that I'm trying to figure out: I have an address table out-of-which I am trying to select mailing addresses for companies UNLESS a mailing address doesn't exist; then I want to select the physical addresses for that company. If I get multiple mailing or physical addresses returned I only want the most recently edited out of those. I don't need this for an individual ID select, I need it applied to every record from the table. My address table has some columns that look like: [AddressID] [int] [LocationID] [int] [Type] [nvarchar](10) [Address] [varchar](50) [City] [varchar](50) [State] [char](2) [Zip] [varchar](5) [AddDate] [datetime] [EditDate] [datetime] AddressID is a primary-key non-null column to the address table and the LocationID is a foreign key value from a seperate Companies table. So there will be multiple addresses to one LocationID, but each address will have it's own AddressID. How can I do this efficiently with perfomance in mind??? Thank you in advance for any and all replies...
View Replies !
View Related
Removing Commas From A Select
I'm trying to export a query to a csv file. Everything works great until I hit the name field. Is there a way to remove commas from a select statement. Here's what my Data looks like Item # | Name ------------------------- 1111 | Acme, Inc 1112 | Test Company, Inc I'd like it to print out as Item # | Name ------------------------- 1111 | Acme Inc 1112 | Test Company Inc Thanks for any help in advance.
View Replies !
View Related
Hiding Or Removing Column Output From Select Statement
I'm executing the following... select COL1, min(COL2) from TABLE group by COL1 the table has many duplicate entries, where COL2 is the primary key and unique, but its the duplicate COL1 entries that have to be removed. I was hoping a simple "delete from table where COL1 not in (select COL1, min(COL2) from TABLE group by COL1)" would do the trick, but obviously in returning two columns from the subselect this won't work. Can I hide the COL2 output from the query that will be put in the subselect? this is a one-off thing, so i'm not overly concerned about overhead or elegance. just need to make it so. tia a
View Replies !
View Related
Parameter: C, I, P, Or ALL...how To Select Based On Parameter?
Hi everyone, I have this semi-complex query that is selecting items from numerous tables residing on 2 different databases. So far the query works perfectly. Here is the problem: The user is given the option of selecting items based on whether a course is Completed (C) Incomplete (I) Passed (P) Failed (F) or (ALL). I am not really sure how to do the select all, the others I can do depending on the value... Any thoughts?? Query: sql Code: Original - sql Code ALTER PROCEDURE [dbo].[Sel_CourseActivityPerUser] ( @status varchar(25), @course varchar(100), @datesmalldatetime ) AS SELECT A1.uLastName, A1.uFirstName, A2.mName, A3.tStatus, A3.tScore, A3.tStartDate, A3.tCompleteDate, A4.cName FROM VSALCP.dbo.[User] as A1 INNER JOIN FSDLMS.dbo.Student as A5 ON A1.uID = A5.stID INNER JOIN FSDLMS.dbo.Transcript as A3 ON A3.t_FK_stID = A5.stID INNER JOIN VSALCP.dbo.Member as A2 ON A2.mID = A1.u_FK_mID INNER JOIN FSDLMS.dbo.Course as A4 ON A4.cID = A3.t_FK_cID Where @status = A3.tStatus ... ALTER PROCEDURE [dbo].[Sel_CourseActivityPerUser] ( @status varchar(25), @course varchar(100), @date smalldatetime )AS SELECT A1.uLastName, A1.uFirstName, A2.mName, A3.tStatus, A3.tScore, A3.tStartDate, A3.tCompleteDate, A4.cName FROM VSALCP.dbo.[User] AS A1 INNER JOIN FSDLMS.dbo.Student AS A5 ON A1.uID = A5.stID INNER JOIN FSDLMS.dbo.Transcript AS A3 ON A3.t_FK_stID = A5.stID INNER JOIN VSALCP.dbo.Member AS A2 ON A2.mID = A1.u_FK_mID INNER JOIN FSDLMS.dbo.Course AS A4 ON A4.cID = A3.t_FK_cID WHERE @status = A3.tStatus ... "If status = ALL select * status" Thanks for taking a look!
View Replies !
View Related
Multi Select Parameter From Function - Select All?
I am using RS 2000. I have a multi select parameter where I can select multiple states by separating with a comma. I am trying to figure out how to incorporate an "All" parameter. Query: Select [name], city, state, zipcode From Golf inner join charlist_to_table(@State,Default)f on State = f.str Function: CREATE FUNCTION charlist_to_table (@list ntext, @delimiter nchar(1) = N',') RETURNS @tbl Table (listpos int IDENTITY(1, 1) NOT NULL, str varchar(4000), nstr nvarchar(2000)) AS BEGIN DECLARE @pos int, @textpos int, @chunklen smallint, @tmpstr nvarchar(4000), @leftover nvarchar(4000), @tmpval nvarchar(4000) SET @textpos = 1 SET @leftover = '' WHILE @textpos <= datalength(@list) / 2 BEGIN SET @chunklen = 4000 - datalength(@leftover) / 2 SET @tmpstr = @leftover + substring(@list, @textpos, @chunklen) SET @textpos = @textpos + @chunklen SET @pos = charindex(@delimiter, @tmpstr) WHILE @pos > 0 BEGIN SET @tmpval = ltrim(rtrim(left(@tmpstr, @pos - 1))) INSERT @tbl (str, nstr) VALUES(@tmpval, @tmpval) SET @tmpstr = substring(@tmpstr, @pos + 1, len(@tmpstr)) SET @pos = charindex(@delimiter, @tmpstr) END SET @leftover = @tmpstr END INSERT @tbl(str, nstr) VALUES (ltrim(rtrim(@leftover)), ltrim(rtrim(@leftover))) RETURN END GO Anyone have any ideas? Thanks, Deb
View Replies !
View Related
Help, Running A Control Flow Item Does Not &&"kick Off&&" The Next Item
Hi, Here's my problem. I have 2 tasks defined in my Control Flow tab: EXECUTE SQL--------->EXECUTE DTS 2000 PACKAGE When I attempt to run it, by right-clicking the EXECUTE SQL task, and selecting "Execute Task", it only runs the EXECUTE SQL part (successfully), and does not "kick off" the EXECUTE DTS 2000 PACKAGE, after it is done running (even though it completes successfully, as shown by the green box). Yes, they are connected by a dark green arrow, as indicated in my diagram above. Why is this?? Am I missing something here? Need help. THANKS
View Replies !
View Related
How To Set Default Parameter To &&"Select All&&" For A Multivalue Parameter
I have a dataset listing distinct values for items (like 1, D10, M4, etc.) The WHERE statement in my query refers to unit IN(@Unit). I then have 2 report parameters to select 1) a date (datetime); and 2) a multivalue parameter to select one or all of the "units". I would like the second parameter to default to "Select All". Can someone tell me how to do this? I'm sure this is a fairly simple thing but I am really struggling. The report parameter is set as multivalue; My "available values" is set to "from query" and refers to my "unit" dataset and the value and label fields are set to "unit" (only field I bring into this particular dataset). The "Default Values" section is set to "from query" , the dataset is set to "unit" and the value is set to "unit". I can preview the report and select a date but the list of units comes up with all boxes unchecked, including "Select All". Any help will be much appreciated. Thanks.
View Replies !
View Related
How To Select Using A Parameter
Hi I will like to bind the listbox control only with the rows where the colums text = categoryX Where do I declare the variable @Category ? If Not Page.IsPostBack Then Dim conPubs As SqlConnection Dim cmdSelect As SqlCommand Dim dtrAuthors As SqlDataReader conPubs = New SqlConnection(ConfigurationSettings.AppSettings("connectionstring")) conPubs.Open() cmdSelect = New SqlCommand("Select * From Slideshows WHERE ([Slideshows].[Category] = @Category)", conPubs) dtrAuthors = cmdSelect.ExecuteReader() ListBox1.DataSource = dtrAuthors ListBox1.DataBind() dtrAuthors.Close() conPubs.Close() End If Best Regards
View Replies !
View Related
Variable In Select Parameter
Hi, I am trying to get the login name of a user, trim off some characters, which works fine, convert this to a string variable, which works fine and then use this variable in an sql select parameter. I've tried countless things and am not sure why my variable @NewString is not working in the Select command. If I add a default value I know is present, it works, but it can't seem to pick up the variable value of NewString. It prints out as expected in the response.write statement, but I really need it to connect to the corresponding value in the database. Any ideas are greatly appreciated-code below. Thanks, Liz <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <SCRIPT LANGUAGE="vb" runat="server"> Public Function LoggedOnUser() As StringReturn (Request.ServerVariables("LOGON_USER")) End Function </SCRIPT> <%Dim MyString As String = LoggedOnUser() Dim MyChar As Char() = {"O"c, "N"c, "E"c, ""c}Dim NewString As String = MyString.TrimStart(MyChar)Response.Write("Hello ") Response.Write(NewString) %> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:pboConnectionString %>" SelectCommand="SELECT [LastName], [FirstName], [logon] FROM [Phonebook] WHERE ([logon] = @NewString)"> <SelectParameters> <asp:Parameter DefaultValue="" Name="NewString" Type="String" /> </SelectParameters> </asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /> <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" /> <asp:BoundField DataField="logon" HeaderText="logon" SortExpression="logon" /> </Columns></asp:GridView> </asp:Content>
View Replies !
View Related
SqlDataSource WHERE IN Select Parameter
Is it possible to use a WHERE-IN statement with a SqlDataSource control. For instance: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectionString %>" SelectCommand="SELECT [Id], [Name], [Phone] FROM [Table1] WHERE ([Id] IN @Id)"> <SelectParameters> <asp:Parameter DefaultValue="( 1, 3, 5, 7, 11 )" Name="Id" Type="Int32" /> </SelectParameters></asp:SqlDataSource> I'm hoping the gridview would then display a table with rows for records 1,3,5,7,11. Thanks for any help...
View Replies !
View Related
SqlDataSource + Parameter + SELECT IN
I'm sure that is really simple, but how do I pass a parameter with multiple value to a SQLdatasource? ex: SELECT field1 from tblTableA where idTableA IN ( @Param1) Let's say I want to pass 1,2,3,4 as Param1 (SELECT field1 from tblTableA where idTableA IN ( 1,2,3,4)) How I am supposed tu use the .SelectParameters.Add() to pass a list of integers instead of a single value?? Thanks in advance.
View Replies !
View Related
Using SELECT LIKE With ADO Parameter In ASP Page
Is it possible and how do I do use a select like query with an adocommand's parameter object?For Example:Instead of this:command.CommandText = "SELECT * FROM Table WHERE field LIKE'%searchString%'This:command.CommandText = "SELECT * FROM Table WHERE field LIKE '%?%'command.Parameters.Append(command.CreateParameter ....Thanks
View Replies !
View Related
Select Parameter Order
Which is more efficientWhere NonindexedColumn=x and IndexedColumn=yorWhere IndexedColumn=y and NonindexedColumn=xor does matter? Will the optimiser work it out?(I'm building the SQL string on the fly in the fron-end)
View Replies !
View Related
SSRS Parameter Select All Help
Please can someone provide an overview of how to select all records in the parameter list. I am trying to get an understanding of how this works. Having a union join with all value is fine, to retrieve the value of 'all'. However, given the data-set there is no 'all' value. From reading the ms course notes, the query syntax is: select from where = (field = @x) or @x = 'all'. How does this syntax work? Does x = all, so all= all = true then returns all records? Regards, Nijojo
View Replies !
View Related
Use Parameter To Select Subreport
I'm not sure if parameters is the correct solution, but it's all I can think of. I'm trying to use a "template" report with a graphic logo and some other standard layout to provide all my subreports with the same look. On the "default" subreport, I intend to have links to the other subreports, but I can't find a way to dynamically change the subreport shown by the Subreport item.
View Replies !
View Related
Parameter To Select Among Databases
I have several databases on the same server that have the same table structures within them. Call them Server.A Server.B Server.C ...etc. I have designed a report that works in one database, say "A". I would like to add a parameter box to the report giving the user the ability to select which database to run the report in. I'm not sure if this is possible. There may be more complex ways to handle this, say, with dynamic SQL or by building a large UNION of select statements across the various databases. But I figured I might ask for a simple solution first. :-)
View Replies !
View Related
Setting A Parameter Value To Select All.
I searched this forum however I could not find an answer to my question. I'm sure it has been asked before but... In my parameter if the user does not select anything, null, then it returns all the records. Second question if he selects "All" then it returns all records. If this is 1st grade stuff please forgive me. I'm pretty new, learning as the needs arise. Thanks CardGunner
View Replies !
View Related
SELECT HTML With Tag From Parameter XML In SQL
consider the following query DECLARE @InputXML XML SET @InputXML = '<Parameters><ID>123</ID><FileName><b>Hello world</b></FileName><Count>3</Count></Parameters>' SELECT AT.value('FileName[1]', 'VARCHAR(50)'), AT.value('Count[1]', 'INT') FROM @InputXML.nodes('/Parameters') X(AT) The file name column returns only "Hello World", how do I make it return the FULL "<b>Hello World</b>" (with tags) Thank you very much
View Replies !
View Related
Select With Table Name Parameter
Hy , I'he made a stored procedure with 1 parameter @cTableName and I want to return data from that table: select * from @cTableName , that is all. But it does not work. When I execute the stored procedurere I want to send the name of the table : execute MySP "MyTable". Is it possible? Thank you!
View Replies !
View Related
|