Showing posts with label values. Show all posts
Showing posts with label values. Show all posts

Friday, March 30, 2012

Populate arraylist from a database

Hi

i'm pretty new to this, how do i connect to my database a put all the values from one column into the arraylist.

Any help and a easy example would be nice

Thanks in advance

Richard

check out this sample, fromASPNet101.com:

http://aspnet101.com/aspnet101/aspnet/codesample.aspx?code=ddlArrayList

|||thanks i give it a go|||

hi i get an error

An error has occurred while establishing a connection tothe server. When connecting to SQL Server 2005, this failure may becaused by the fact that under the default settings SQL Server does notallow remote connections

heres my code

<%@. Page Language="VB" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SQLClient" %>
<html>
<head>
<meta name="GENERATOR" Content="ASP Express 2.1">
<title>Untitled</title>
<script language="VB" runat="server">
Dim MyArrayList as ArrayList
Dim sItem as String
Sub Page_Load(Source as Object, E as EventArgs)
MyArrayList=New Arraylist
if not Page.IsPostBack then
Dim strConn As String = "server=YourServer;uid=UID;pwd=PWD;database=Holiday"
Dim MySQL As String = "SELECT startDate FROM holidayRequest"
Dim MyConn as New SQLConnection(strConn)
Dim objDR as SQLDataReader
Dim Cmd as New SQLCommand(MySQL, MyConn)
MyConn.Open()
objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
While objDR.Read()
MyArrayList.Add(objDR("startDate"))
End While
end if
ddl1.datasource=MyArrayList
ddl1.databind
End Sub
</script>
</head>
<body
<Form id="form1" runat="server">
<asp:DropDownList id="ddl1" runat="server" />
</Form>
</body>
</html>

the database i'm connecting too is on my computer and is called Holiday.mdf and the table i'm trying to get too is holidayRequeststart and from that i'm trying to get the startDate out.

Please help i'm new to this and prob done a stupid erro

|||Make sure your connection string is pointing to an available SQL instance on your computer. If you're using a default SQL instance, it'ok to refer to it using server=YourServer; if it is a named SQL instance, you can set server to something likeYourServer\SQLInstanceName.

Friday, March 23, 2012

Point Label Properties

I have a stacked barchart with point labels applied. For some time periods
some of the values are zero. When this occurs, the zero lables stack up at
the bottom of the chart and appear very unattractive. Is there a way I can
conditionally format the point labels so that they only show if greater than
zero'Try ### in the format code box (number of #'s = max digits of any value in
you graph)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
"bugfish69" wrote:
> I have a stacked barchart with point labels applied. For some time periods
> some of the values are zero. When this occurs, the zero lables stack up at
> the bottom of the chart and appear very unattractive. Is there a way I can
> conditionally format the point labels so that they only show if greater than
> zero'|||Thank you. Why is the obvious so hard to see sometimes?
"Marcus K" wrote:
> Try ### in the format code box (number of #'s = max digits of any value in
> you graph)
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
> "bugfish69" wrote:
> > I have a stacked barchart with point labels applied. For some time periods
> > some of the values are zero. When this occurs, the zero lables stack up at
> > the bottom of the chart and appear very unattractive. Is there a way I can
> > conditionally format the point labels so that they only show if greater than
> > zero'sql

Point label position not where expected

I have a simple column chart with point labels. The values are displaying at a -90 angle. I want the values to display in the center of the column, but when I choose the center position, it is displaying at the top; half of the value is in the bar and the other half above. Why?

I believe it places the point label as close to the position as you have set and attempts to avoid running into any other rendered images on your report.

You may want to try scaling the chart so that there is more room for the label to fit. Does your chart seem "crampted"?

|||I don't think it is cramped. There is a main chart which takes up the majority of the page. Then there are three smaller charts lined up vertically off to the right. It is these charts that I'm trying to get the point labels lined up correctly. There are only three bars per chart. To me, it doesn't look like there should be a problem with getting the label centered. I even tried making one of these charts much larger, and it did not change the position at allSad

Point Label not displaying on a bar chart

I am using Reporting Services 2000.

I have one bar chart that has two values and one group. Everything works fine except when two values are returned, then the point label for the top bar never displays. Example

A (has 2 bars)

B (has 2 bars)

Only the top bar for A will not display the point label. I can change the sort order and make A appear first and then the top bar for B doesn't have the point label now. When I change the order of the values, the top bar that didn't have the label has one because it is second from the top, but the new top bar doesn't. Is this a bug or am I doing something wrong. Thanks.

Try to turn on margins for the x-axis.

-- Robert

|||

Hi Robert,

Thank you so much , your solution is working

thx again

ragards,

-sandyee

Point Label not displaying on a bar chart

I am using Reporting Services 2000.

I have one bar chart that has two values and one group. Everything works fine except when two values are returned, then the point label for the top bar never displays. Example

A (has 2 bars)

B (has 2 bars)

Only the top bar for A will not display the point label. I can change the sort order and make A appear first and then the top bar for B doesn't have the point label now. When I change the order of the values, the top bar that didn't have the label has one because it is second from the top, but the new top bar doesn't. Is this a bug or am I doing something wrong. Thanks.

Try to turn on margins for the x-axis.

-- Robert

|||

Hi Robert,

Thank you so much , your solution is working

thx again

ragards,

-sandyee

Friday, March 9, 2012

Plotting lines and data points on scatter chart

I'm trying to produce a chart that has both actual data values from a database and matching "line of best fit" plots on the one chart. I have 4 data series, 2 of the actual data values and 2 that represent the values for the "line of best fit". What I want to do is:

Plot the actual values just as data points (joining them with lines in meaningless) and

Plot the "line of best fit" values as a line.

When I edit the data series on the scatter chart, I can see the "Plot data as line" option but it is "greyed" out.

Have I missed something really simple here or is this not possible. I'm using RS2005

Many thanks

Simon

Hi Simon,

I have the same problem now.

Have you found a solution for your problem?

Thanks

Gerd

Plotting lines and data points on scatter chart

I'm trying to produce a chart that has both actual data values from a database and matching "line of best fit" plots on the one chart. I have 4 data series, 2 of the actual data values and 2 that represent the values for the "line of best fit". What I want to do is:

Plot the actual values just as data points (joining them with lines in meaningless) and Plot the "line of best fit" values as a line.

When I edit the data series on the scatter chart, I can see the "Plot data as line" option but it is "greyed" out.

Have I missed something really simple here or is this not possible. I'm using RS2005

Many thanks

Simon

Hi Simon,

I have the same problem now.

Have you found a solution for your problem?

Thanks

Gerd