Changing From Dropdowns To Datepickers

Feb 13, 2007

Hi guys,

just a simple question here: i have some input parameters on my report that are datetimes (i.e. the user gets the date picker to select the date), if i want to use that parameter in a MDX statement what will it look like? IOW would today's date look like the string "13/02/07", or would i be expecting a string like this: "2007/02/13 00:00"?

I am looking to convert some dropdowns that contain dates extracted from a cube heirarchy with the datepickers so i need to know what i have to change in the MDX to accomodate this.

I also filter the dates that appear in the current dropdowns, is there a way to do this with the datepickers (maybe by pointing them to a dataset of dates extracted from the cube)?

Thanks!

sluggy

View 3 Replies


ADVERTISEMENT

Changing Parameter In SQLDataSource For Multiple DropDowns

Aug 29, 2007

I have one page, one connection, and three dropdowns. The connection looks like (as an example):<asp:SqlDataSource ID="DropDownConn" runat="server" ConnectionString="<%$ ConnectionStrings:aousConnectionString %>" SelectCommand="SELECT [Value], [Text] FROM [DropDown] WHERE (([Group] = @Group) AND ([Viewable] = @Viewable))"> <SelectParameters>  <asp:Parameter Name="Group" Type="String" />  <asp:Parameter DefaultValue="True" Name="Viewable" Type="Boolean" /> </SelectParameters></asp:SqlDataSource>
The DropDowns Look like this: 
<asp:DropDownList ID="DropDown1" runat="server"></asp:DropDownList><asp:DropDownList ID="DropDown2" runat="server"></asp:DropDownList><asp:DropDownList ID="DropDown3" runat="server"></asp:DropDownList>The C# Code I am trying is like this:DropDownConn.SelectParameters["Group"].Equals("DropDown1");DropDownConn.SelectParameters["Viewable"].Equals(true);DropDown1.DataSourceID = "DropDownConn";DropDown1.DataTextField = "Text";DropDown1.DataValueField = "Value";DropDown1.DataBind();
As an example. I can not get it done so that I don't have to create 3 dataconnections. Any help, PLEASE?

View 2 Replies View Related

Dropdowns

Jul 3, 2007

I am trying to filter data on a report by using drop downs. I have been able to create the drop downs, however I can only get one to actually filter content. I need to allow users to select the group from drop down one, and then a different group from drop down 2 so the end result will only display informaiton that matches both drop downs.

Any suggestions will be appreciated. Below is the code if needed

<SqlVariable name="V_Queue" display="Queue :" type="dbselect" displaycolumn="display" datacolumn="group_name" default="%">
<SelectQuery mssql="true" oracle="false" db2="false">
<![CDATA[ SELECT group_name, group_name AS display FROM table_1 WHERE group_name like '%cat1%' UNION SELECT '%' AS group_name, 'All' AS display ]]>
</SelectQuery>
</SqlVariable>
<SqlVariable name="Group" display="Group :" type="dbselect" displaycolumn="display" datacolumn="group_name" default="%">
<SelectQuery mssql="true" oracle="false" db2="false">
<![CDATA[ SELECT group_name, group_name AS display FROM table_1 WHERE group_name like '%group%' UNION SELECT '%' AS group_name, 'All' AS display ]]>
</SelectQuery>
</SqlVariable>

View 1 Replies View Related

Multiple DropDowns Error

Feb 27, 2006

Hi:
I have two drop downs bound to the same data source.. These dropdowns are automatically populated from a database. When I click the button I get some sort of strange query error.
Not sure what I'm doing wrong here.
 
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>
<script language="VB" runat="server">
Dim sOrderby as String
Dim sDirection as String
Dim MySQL As String
Dim MySQL1 As String
Dim sSubject As String
Dim sCategory As String
 


Sub Page_Load(ByVal Source As Object, ByVal E As EventArgs)

If Not Page.IsPostBack Then
Dim strConn As String = "server=GAALP-DT-UHABB2CFW;uid=sa;pwd=removed;database=NetG"
Dim MySQL As String = "Select DISTINCT [Subject] from dbo_v_netG_courses"
Dim MySQL1 As String = "Select DISTINCT [Category] from dbo_v_netG_courses"
Dim MyConn As New SqlConnection(strConn)
Dim objDR As SqlDataReader
Dim Cmd As New SqlCommand(MySQL, MyConn)
Dim Cmd1 As New SqlCommand(MySQL1, MyConn)
MyConn.Open()
objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
ddl.DataSource = objDR
ddl.DataValueField = "Subject"
ddl.DataTextField = "Subject"
ddl.DataBind()
MyConn.Close()
MyConn.Open()

ddlDir.DataSource = Cmd1.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
ddlDir.DataValueField = "Category"
ddlDir.DataTextField = "Category"
ddlDir.DataBind()

MyConn.Close()
ddl.Items.Insert(0, "-- Choose --")
ddlDir.Items.Insert(0, "-- Choose --")
End If
'ddl.Items.Insert(0, "-- Choose --")
End Sub
 
' Sub Page_Change(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
' MyDataGrid.CurrentPageIndex = e.NewPageIndex
' BindData()

'Sub GridOne(ByVal Source As Object, ByVal E As EventArgs)
' MyDataGrid.CurrentPageIndex = 0
'End Sub

'Sub GetData(ByVal Source As Object, ByVal E As EventArgs)
' BindData()
' End Sub
Sub BindData(ByVal Source As Object, ByVal E As EventArgs)

sSubject = ddlDir.SelectedItem.Text
sCategory = ddlDir.SelectedItem.Value
Dim strConn As String = "server=GAALP-DT-UHABB2CFW;uid=sa;pwd=removed;database=NetG"
If sSubject = "" And sCategory = "" Then
MySQL = "Select * from dbo_v_netG_courses"
 
Else ( THIS LINE IS GIVING ME THE ERROR)
MySQL = "Select * from dbo_v_netG_courses where [Subject] = & sSubject"
End If
Dim MyConn As New SqlConnection(strConn)
Dim ds As DataSet = New DataSet()
Dim Cmd As New SqlDataAdapter(MySQL, MyConn)
Cmd.Fill(ds, "dbo_v_netG_courses")
MyDataGrid.DataSource = ds.Tables("dbo_v_netG_courses").DefaultView
MyDataGrid.DataBind()
End Sub
 


</script>
<html>
<head>
<meta name="GENERATOR" Content="ASP Express 3.0">
<title>Ad Hoc Sorting with a DataGrid</title>
</head>
<body>
<Form id="form1" runat="server">
<table>
<tr>
<td align="Left" valign="Top"><b><i>View Employee Data</i></b></td>
<td align="right" valign="Top">
Subject: <asp:dropdownlist id="ddl" runat="server">
</asp:dropdownlist>
Category: <asp:dropdownlist id="ddlDir" runat="server">
</asp:dropdownlist><br />
<br />
<asp:Button id="btn1" Text="View Records" onclick="BindData" runat="server" /><br />
</td>
</tr>
<tr>
<td align="Left" valign="Top" Colspan="2">
<asp:Datagrid runat="server"
Id="MyDataGrid"
GridLines="Both"
cellpadding="0"
cellspacing="0"
Headerstyle-BackColor="#8080C0"
Headerstyle-Font-Bold="True"
Headerstyle-Font-Size="12"
BackColor="#8080FF"
Font-Size="10"
AlternatingItemStyle-BackColor="#EFEFEF"
AlternatingItemStyle-Font-Size="10"
BorderColor="Black">
</asp:DataGrid><br> &nbsp;</td>
</tr>
</table>
</form>
</body>
</html>
 
 
 

View 2 Replies View Related

SQLDatasource And Dropdowns && Extra Data

May 27, 2007

I’m using a SQLDataSource to populate a dropdown. The SQL table I use to populate the drop down has two columns. I only want one of them to be displayed in the drop down but I need to make decisions later in the code based on both columns. How do I access that second column in the datasource?

View 4 Replies View Related

Populating A Form, Dropdowns Not Working

Nov 23, 2007

Hi All,
I have literally spent the last 2 1/2 hours troubleshooting an issue where I pass a parameter to the page and based on the parameter it runs a SQL statement and fills in the fields on the form.  It is giving me the error message below but I know its not a NULL value and I know those controls are named correctly.
System.NullReferenceException: Object reference not set to an instance of an object.All of my textboxes and labels that are being populated are working fine when I comment out the dropdowns, I have this working on other pages but the only thing that is different here is I am using some AJAX (Autocomplete, Collapsable Panel and Calendar Control). 
If I add a label or a textbox field on the form and take the same value that is going to populate the dropdownlist and populate the new control it works, so i know I'm getting the data and its not null/nothing.  I also verified that the parameter is working correctly. 
Any help will be a blessing, its probably something write under my nose!Thanks in advance!Tim
Here is the codeDim conn As SqlConnectionDim comm As SqlCommandDim reader As SqlDataReaderDim connectionstring As String = ConfigurationManager.ConnectionStrings("MagicDEV").ConnectionStringDim SeqIncident As Integer = Convert.ToInt16(Request.QueryString("NAME"))
If SeqIncident > 0 Thenconn = New SqlConnection(connectionstring)comm = New SqlCommand("Select isnull(t.[Sequence],'') as SeqIncident, " & _"isnull(t.Client,'') as SeqClient, " & _"isnull(c.Client,'') as Client, " & _"isnull(t.[Open By],'') as SeqOpenBy, " & _"isnull(p.[Code],'') as OpenedBy, " & _"isnull(t.[Sent To],'') as SeqAssignedTo, " & _"isnull(p1.code,'') as AssignedTo, " & _"isnull(t.[Date Open],'') as DateOpen, " & _"isnull(t.[Closed On],''), " & _"isnull(t.[Closed By],'') as SeqClosedBy, " & _"isnull(p2.[Code],'') as ClosedBy, " & _"isnull(t.[Seq_Severity:],'') as SeqUrgency, " & _"isnull(s.[Name],'') as Urgency, " & _"isnull(t.[Seq_UdStatus:],'') as SeqStatus, " & _"isnull(u.[id],'') as Status, " & _"isnull(t.Contact_Type,'') as ContactType, " & _"isnull(t.Ctrpart,'') as SeqAsset, " & _"isnull(i.[Asset#],'') as Asset, " & _"isnull(t.seq_rpt_party,'') as SeqRptParty, " & _"isnull(c1.client,'') as RptParty, " & _"isnull(t.Whiteboard_ID,'') as SeqWhiteboard, " & _"isnull(w.Whiteboard_ID,'') as Whiteboard, " & _"isnull(t.Subject,'') as SeqSubject, " & _"isnull(s1.[Description],'') as Subject, " & _"isnull(t.[Description],'') as IncDescription, " & _"isnull(t.Resolution,'') as IncResolution, " & _"isnull(t.[FCR:],'') as FCC, " & _"isnull(t.Sent_Ack,'') as SentAck, " & _"isnull(t.Inc_Closed,'') as IncClosed, " & _"isnull(t.RC,'') as RC " & _
"From _Smdba_._Telmaste_ t " & _"inner join _Smdba_._Customer_ c on t.client = c.[Sequence] " & _
"left outer join _Smdba_._Personnel_ p on t.[open by] = p.[Sequence] " & _"left outer join _Smdba_._Personnel_ p1 on t.[Sent To] = p1.[Sequence] " & _
"left outer join _Smdba_._Personnel_ p2 on t.[Closed By] = p2.[Sequence] " & _"left outer join _Smdba_._Severity_ s on t.[Seq_Severity:] = s.[Sequence] " & _
"left outer join _Smdba_._UdStatus_ u on t.[Seq_UdStatus:] = u.[Sequence] " & _"left outer join _Smdba_._Inventor_ i on t.[Ctrpart] = i.[Sequence] " & _
"left outer join _Smdba_._Customer_ c1 on t.seq_rpt_party = c1.[Sequence] " & _"left outer join _Smdba_._Whiteboard_ w on t.Whiteboard_ID = w.[Sequence] " & _
"left outer join _Smdba_._Subjects_ s1 on t.Subject = s1.[Sequence] " & _"Where t.Sequence = @Sequence1", conn)
comm.Parameters.Add("@Sequence1", Data.SqlDbType.Int)
comm.Parameters.Item("@Sequence1").Value = SeqIncident
Try
conn.Open()
reader = comm.ExecuteReader()
reader.Read()ClientDropDown.SelectedItem.Text = reader.Item("Client")
ClientDropDown.SelectedItem.Value = reader.Item("seqclient")
Finallyconn.Close()End TryEnd If

View 2 Replies View Related

Query Defining Parameter Dropdowns Is Run Twice!

Jan 24, 2007

I built a very simple report which uses a query to define the options in the parameters dropdown. I used that same dataset to define the default for that parameter (meaning that it will just pick the first row from the dataset and use that as the default). When I run the report watching a Profiler trace on the SQL database, it runs that query twice. (Presumably, thats once to fill the dropdown list and once to figure out the default.) That seems silly to me since it is the same query that is the same dataset in Reporting Services. Is there any way around this? My parameter bar is rendering twice as slowly as it should be.
 
I've tested against SSRS 2005 SP1 and the CTP of SP2.

View 2 Replies View Related

Changing The Sqldataroot

Dec 14, 2000

A college forgot to change the data root when installing a developer server. My question is can this be changed whitout reinstalling the server and restoring the developer databases.
I found sqldataroot under [HKEY_LOCAL_MACHINESoftwareMicrosoftMSSQLServerSetu pSQLDataRoot]
If I stop the sql server and change this value and move the *.mdb and *.ldf files. Would I risk currupting the databases and do I need to change something else? For example would changeing this value change the default path for backupdevices?

View 2 Replies View Related

Changing Passwords

Dec 5, 2000

I have a problem where our developers would like to change the passwords of the SQL Logins without knowing the users old password.

The only way they can use the below syntax is that they must be a member of the SYSAdmin Server Role.

sp_password NULL, 'newpassword',Max

I need a way to allow them to change the passwords without making a user a member of the SYSAdmin Server Role.

Any thoughts would be greatly apprecitated. Thanks in advance.

Max

View 1 Replies View Related

Changing Security

Dec 20, 2000

I need to change my security settings from "Windows NT Only" to "SQL Server and Windows NT". Does anyone know of any issues with doing this? Does this subtract anything or does it only add access??

View 1 Replies View Related

Changing License Key

Jun 5, 2002

Is there a way to change the license key after installation of SQL7.0?

View 1 Replies View Related

Changing Database Name

Nov 19, 2002

hi, I have created a database in sql server 2000. I need to duplicate the database under different name, how can I do that?
Also, can I rename a database name?
thanks
Ali

View 3 Replies View Related

Changing Server Name

Dec 7, 1999

Hi all,

I need to change the NT Server computer name (and the SQL Server name). I know how to do it in NT, but how would I go about changing the SQL Server name. Can anyone help me with this? Is this an easy process?

Thanks,
LC

View 3 Replies View Related

Someone Changing Permissions..

Mar 1, 2005

Someone is changing permissions on our production sql databases frequently which is causing big problems..any idea how to know who is changing and when? Any code that can be written to capture such activity?

thanks,
dbfan.

View 6 Replies View Related

Changing The Sa Password

Aug 6, 1998

I`m running SQL 6.5 with standard security. We`re running NT 4.0. I am a member of the NT Admin group - which, of course, has sa privileges in SQL Server. I changed the sa password (via Enterpise Manager on my client machine); and it worked. I tested the password change by connecting to ISQL/w - both on my client machine and at the server machine.

However, when I attempted to connect to the server via Enterprise Manager (SEM) - on my client machine - my login attempt failed. But at the server machine, I connected just fine.

Somehow, even though we`re using standard security, I`m getting locked out of SEM because of the new password. Changing the sa password back to what it had been resolved the problem; but the old password was only meant to be temporary.

Any suggestions or explanations?

View 3 Replies View Related

Changing SA Passwword

Dec 15, 1998

Hi,

During SQL installation I left the SA password blank. Now when I try to change it, the event log fills up with the following errors:

Mesg 18456 : Login failed- User: sa.
I am using SQL database for SMS and I have a SMS service account.
The error type in event viewer is "Failure Audit".

I am stopping and starting SQL once changes are made. I am also registering server with "Use Trusted Connection". I have also tried with "Use Standard Security" and the SA account.

Can anyone tell me how to change my SA password without affecting my SMS service account?

Thanks,

Terry

View 1 Replies View Related

Changing Column Name

Nov 9, 2004

Hi all,

I have a table that has integrity constraints in place and it is populated with the data. I need to rename one of the columns in the table. I am hesitant to use sp_rename procedure because when I used it before I get a warning message that says "changing any part of an object name could break scriptd and stored procedure." how big of a problem is it? Is there any other way to do it without hearting anything? Thanks.

View 1 Replies View Related

Changing A Column Name

Nov 30, 2005

How can you change a Column name for MS SQL 2000 ?

something like :

ALTER TABLE [dbo].[MyTable]
OldName RENAME NewName
GO

thank you

View 6 Replies View Related

Changing Collations...

Mar 2, 2006

I have looked thru the forum but have a couple of questions:
1) data base was created with case insensitive collation
2) all the tables were then create (72 tables) and by default got the CI collation on all columns
3) lots of data was added 2GB
4) discovered mistake and altered the database to have case sensitive collation
5)..... how to change all the collations for all the columns without doing them all manually
can i backup the database and change some settings and restore it?
export all the data, drop and recreate tables and import data?
????

View 7 Replies View Related

Tracking Who Is Changing What?

Aug 9, 2006

We are building an inventory management system complete with BOM. It is important to track what employee is updating what tables. Currently all such tables have a Date field that is updated when a change is made, and an EmployeeID field which records the employee making the change. I am wondering if someone knows of a better way to track this information. Any suggestions?

View 4 Replies View Related

Changing Formats

Apr 25, 2007

Hey guys,
I have a file that has date formatted like so: 2006-11-16 20:12:00
I would like the dateformat to be like mm/dd/yyy hh:mm

The file is being pulled into a varchar field..... as 2006-11-16 20:12:00
when I do a conversion i can only get it to mon 11,2006


any suggestions

View 1 Replies View Related

Changing Compatability From 65 To 80

Apr 21, 2008

Finally, I may have a good enough excuse to justify changing the compatabilty level of one of the biggies I look after!

Before I go ahead with the change I just wanted to run a couple of questions passed the community.
I know this is very vague, but what sort of problems should I expect? I know there are a few syntax changes, but I don't imagine I will have a problem going up in compatability level!
What is the best method to perform this?
A very simple

EXEC sp_dbcmptlevel 'playdb', 80

Or

ALTER DATABASE SET SINGLE_USER
EXEC sp_dbcmptlevel 'playdb', 80
ALTER DATABASE SET MULTI_USER

How long does this process take; are we talking seconds, minutes, hours? I imagine it's seconds, but I pose this question because a colleague reckons it will take longer because of the database size. I argue that because it's a db configuration setting, it will make no difference...

Thanks a bunch,
George

View 14 Replies View Related

Changing A Date

Jan 25, 2012

SO, If I had a problem with server computer date & stored false dates for some operations, How can I alter those dates to correct dates.

View 1 Replies View Related

Changing Server Name

Jan 29, 2004

Hi. Sorry to be asking this. I know there is a KB article with the steps for changing a SQL2K server name, but I can't find it for the life of me.

Anyone have it tagged?

TIA

View 3 Replies View Related

Changing Server Name

Oct 8, 2015

We are going to install new SQL Server 2014 on Windows 2012 R2. There is a copy of this server which is running on SQL Server 2005. This one has old operating system and wont be able upgrade to SQL Server 2014.

After doing some checks on 2014 we would like to change this server-name with the old server-name which is running on 2005.how can we change the server-name?

View 4 Replies View Related

Changing The Name Of The Server Name

Jun 17, 2008

Hi Experts,

Can someone help me in knowing what is the impact if I happens to change the name of the computer / name of the Server name.

Thanks in advance

View 1 Replies View Related

Changing Date Value

Feb 27, 2014

I have the following field “Period_DT” displayed as “2012-12-01” how can i make it ‘2012-12-01 00:00:00’

Column Name : Period_DT
Date type : Date

View 2 Replies View Related

Changing Value Of A Field

Jun 5, 2006

Bob writes "I want to change the value of a field but it is part of a
unique index. Can someone help me do this.
I need to update about 55000 rows.

thank you very much."

View 2 Replies View Related

Changing The Collation

Jun 6, 2006

Hi!

I have a database in SQL Server 2005 Express edition in standard collation. And now I need to store data including letter "è" (I'm from Slovenia). Can please someone tell me how to change the collation in server and database, please?

Thanks in advanced,
d

View 7 Replies View Related

Changing Servers

Jan 24, 2007

I have read all the FAQs on restore and find myself still confused.
So I apologize if the information is there and I am missing it.
I want to move the databases from an old server to a new server, brand new, will be the same name and IP address once the database is transfered.
Everything I have read says do a full back up and then restore onto the new server. Makes sense so far, my question is how does the Database Master get handled?
Is it necessary to restore it?
If so what is the best way to go about it?

Thanks for your help

View 12 Replies View Related

Changing SA Password

Mar 27, 2007

Is there a thread that says what should we be looking for if I change password for SA?

I am new to the org here and have to clamp down on the SA logins.

This is what comes to my mind:

1.Client apps:
====================
a.Hard coded into VB apps
b.File DSNs
c.System DSNs

2.Web app:
================
a.Hard coded into .asp and .aspx
b..inc files that have collective connection strings.
c.Possible use of file DSNs
d.Possibly use of system DSNs

3.Ad-hoc Queries by Users
===============================

4.Maintenance Plans and Jobs etc.
=======================================
a. DTS packages
b. Replication

Is there anything else that you can add to this list will be helpful.
Regards
Paresh

Regards
Paresh Motiwala
Boston, USA

View 4 Replies View Related

Changing SP With The Changes In The Table

Jun 1, 2007

Hi All,

If the column names are changed , is there are a easy way to change the referred columns in the SP's. What I am doing is going into each SP and replace the old name with the new name.

Thank you for any help on this.




Necessity is the mother of all inventions!

View 18 Replies View Related

Changing SA Password

Jun 9, 2007

Is there any strategy I should follow in order to change the SA password.Experts answers only. Thanks

=============================
http://www.sqlserverstudy.com

View 20 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved