Thursday, March 29, 2012
Boolean parameter label
I have a parameter of type Boolean. The available values are non-queried
with labels 'YES' and 'NO' and the values are obviously True and False,
respectively. When the report renders, I get the two option buttons, but the
labels are 'true' and 'false'. What did I miss?
--
Michael White
Programmer/Analyst
Marion County, ORIIRC available values and labels are not applicable in case of boolean
parameter.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael" <xxx.xxx.xxx> wrote in message
news:%2311IFe5ZFHA.3224@.TK2MSFTNGP10.phx.gbl...
> Hi all..
> I have a parameter of type Boolean. The available values are non-queried
> with labels 'YES' and 'NO' and the values are obviously True and False,
> respectively. When the report renders, I get the two option buttons, but
> the
> labels are 'true' and 'false'. What did I miss?
> --
> Michael White
> Programmer/Analyst
> Marion County, OR
>sql
Tuesday, March 27, 2012
Boolean Data Type not available (workaround for checkbox.checked storing?)
I have a page for inventory price entry that I have used for a while. Now I need to add a checkbox for whether or not the price includes shipping. I added the checkbox to the form and had it posting 'True' or 'False' to the database as nchar(10) data type. When the gridview pulls up the data, I have the Item Template like this, so it shows a disabled checkbox either checked or not:
<asp:CheckBoxID="CheckBox2"runat="server"Checked='<%# Convert.ToBoolean(Eval("Shipping")) %>'Enabled="False"/>
This works fine for displaying the values, but I copied the checkbox to the Edit Item Template, but did not disabled this one. At first, I didn't change the databindings, leaving it Convert.ToBoolean(Eval("Shipping")), which allowed me to go into Edit mode, change the checkbox, then click update. At which point it would return to it's original state (meaning Update wasn't actually updating). However if I change the databindings, then the page won't display.
I checked the SQL statement, and sure enough, it has the
UpdateCommand="UPDATE [PartsTable] ... SET [Shipping] = @.Shipping... WHERE [PartID] = @.original_PartID
After fiddling with the sql statement, now I get Object cannot be cast from DBNull to other types. I think that means that the checkbox is sending a null value to the database.
Any insight as to how to get this to work is much appreciated. Thanks in advance.
I don't know if this will work declaratively but your problem is ANSI SQL Boolean is three valued True/False/Null the reason ANSI SQL is called three valued logic. The links below will show how to use Nullable types of FCL(framework class library) 2.0 to solve your problem. Hope this helps.
http://www.codeproject.com/csharp/c__20_nullable_types.asp
http://www.c-sharpcorner.com/UploadFile/PashuSX/NullableTypes04282006114548AM/NullableTypes.aspx?ArticleID=b28a5114-a92a-4ced-a23c-06d8a29de6e4
|||I found this thread:http://forums.asp.net/thread/1092916.aspx and after reading it, I've changed the data type in the database to Bit. This has significantly helped my problem .
BUT I have the checkbox in normal mode displaying perfectly fine. However, when I click edit, there is a textbox that displays either True or False (True is 1 and False is 0 in the database). If I change True to 0 or False to 1, it works. HOWEVER I want it to display a textbox. When I delete the textbox in the edit template, replace it with a checkbox and then set the databinding to the shipping field, I can click edit and the box appears just fine, but when I change it and click update, I get this Error:Syntax error converting the nvarchar value 'False' to a column of data type bit.Which to me means that it is trying to post the checkbox.checked ='s value, not just checkbox.checked which is stored as a bit in the database.
How/Where can I change this?
|||Figured it out! Turns out the auto generated update statement set the paramenter to<asp:ParameterName="Shipping"Type="String"/>
So I took out the Type="String" and it fixed my problem.
Thanks.
|||I am glad to see your problem is resolved.Friday, February 24, 2012
Blank value when displaying parameter label
I've got the following problem in a report:
I've got a parameter that i'm manually giving available values and labels.
When i'm trying to display this parameter's label into a tabcell
(Parameters!paramNAME.Label), i've got a blank value (in VS.NET and in the
ReportManager).
Is there a way to fix this issue ?
Best Regards,
Grégory.Greg,
Are you trying to do this in report designer? Have you set a prompt string
for the report parameter on the report parameters dialog?
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"Greg - NEOS" <GregNEOS@.discussions.microsoft.com> wrote in message
news:3B6D9848-7DBE-4B4D-B9EE-3B23B969ABAD@.microsoft.com...
> Hi,
> I've got the following problem in a report:
> I've got a parameter that i'm manually giving available values and labels.
> When i'm trying to display this parameter's label into a tabcell
> (Parameters!paramNAME.Label), i've got a blank value (in VS.NET and in the
> ReportManager).
> Is there a way to fix this issue ?
> Best Regards,
> Grégory.|||Hi Lukasz,
Yes i'm trying to do this in the report designer. The result is identitical
once the report is deployed. And there is a prompt string for this particular
parameter.
Any idea ?
Thanks in advance.
Grégory.
"Lukasz Pawlowski [MSFT]" wrote:
> Greg,
> Are you trying to do this in report designer? Have you set a prompt string
> for the report parameter on the report parameters dialog?
> -Lukasz
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Greg - NEOS" <GregNEOS@.discussions.microsoft.com> wrote in message
> news:3B6D9848-7DBE-4B4D-B9EE-3B23B969ABAD@.microsoft.com...
> > Hi,
> >
> > I've got the following problem in a report:
> >
> > I've got a parameter that i'm manually giving available values and labels.
> > When i'm trying to display this parameter's label into a tabcell
> > (Parameters!paramNAME.Label), i've got a blank value (in VS.NET and in the
> > ReportManager).
> >
> > Is there a way to fix this issue ?
> >
> > Best Regards,
> > Grégory.
>
>
Sunday, February 12, 2012
bizarre performance issue
CPU and RAM available. There is no blocking. I cannot find any table scans,
(other than - - 120 row temp table scans) nor does the Index Tuning Wizrd
recommend that I add anything. No software other than SQL Server and some
CommVault backup software are on the box. But still, performance is all over
the place. Sometimes everything is humming right along between 3 and 5
seconds, but later on it will be between 40 and 50 seconds. Of course I see
all of these Procs in Profiler, but everything appears to be OK with them.
Ive been on this all day and am really at a loss as to what to do from here.
Any ideas?
--
TIA,
ChrisRThat is not much to go on. What is it you are doing? 3 to 5 seconds isn't
humming along in my book but it is hard to say without seeing what you are
trying to do. No that it should make that much of a difference but maybe
you are getting a lot of recompiles due to the temp table populations. Have
you tried replacing them with table vars? They sound like the optimal size
for table vars over temp tables.
--
Andrew J. Kelly SQL MVP
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:594022ED-21B3-44F6-84A3-803F877D243D@.microsoft.com...
> Ive got a box that is having bizarre performance behavior. There is plenty
> of
> CPU and RAM available. There is no blocking. I cannot find any table
> scans,
> (other than - - 120 row temp table scans) nor does the Index Tuning Wizrd
> recommend that I add anything. No software other than SQL Server and some
> CommVault backup software are on the box. But still, performance is all
> over
> the place. Sometimes everything is humming right along between 3 and 5
> seconds, but later on it will be between 40 and 50 seconds. Of course I
> see
> all of these Procs in Profiler, but everything appears to be OK with them.
> Ive been on this all day and am really at a loss as to what to do from
> here.
> Any ideas?
> --
> TIA,
> ChrisR|||ChrisR wrote:
> Ive got a box that is having bizarre performance behavior. There is
> plenty of CPU and RAM available. There is no blocking. I cannot find
> any table scans, (other than - - 120 row temp table scans) nor does
> the Index Tuning Wizrd recommend that I add anything. No software
> other than SQL Server and some CommVault backup software are on the
> box. But still, performance is all over the place. Sometimes
> everything is humming right along between 3 and 5 seconds, but later
> on it will be between 40 and 50 seconds. Of course I see all of these
> Procs in Profiler, but everything appears to be OK with them. Ive
> been on this all day and am really at a loss as to what to do from
> here. Any ideas?
When you say the procs, as they appear in Profiler, appear ok, what do
you mean? If they are in fact appearing within your expected performance
parameters, you should see CPU, Reads, and Duration figures that are
normal. Duration should be in the 3,000 - 5,000ms range as you mentioned
and in all likelyhood, performance at the client should be good as well.
If OTOH you are seeing a Duration of 30,000ms or elevated CPU or Read
activity, then I'm guessing that Profiler is showing you there is a
problem.
Can you be more specific about any differences in the Profiler output
between good and bad performance.
David Gugick
Quest Software
www.imceda.com
www.quest.com
bizarre performance issue
f
CPU and RAM available. There is no blocking. I cannot find any table scans,
(other than - - 120 row temp table scans) nor does the Index Tuning Wizrd
recommend that I add anything. No software other than SQL Server and some
CommVault backup software are on the box. But still, performance is all over
the place. Sometimes everything is humming right along between 3 and 5
seconds, but later on it will be between 40 and 50 seconds. Of course I see
all of these Procs in Profiler, but everything appears to be OK with them.
Ive been on this all day and am really at a loss as to what to do from here.
Any ideas?
TIA,
ChrisRThat is not much to go on. What is it you are doing? 3 to 5 seconds isn't
humming along in my book but it is hard to say without seeing what you are
trying to do. No that it should make that much of a difference but maybe
you are getting a lot of recompiles due to the temp table populations. Have
you tried replacing them with table vars? They sound like the optimal size
for table vars over temp tables.
Andrew J. Kelly SQL MVP
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:594022ED-21B3-44F6-84A3-803F877D243D@.microsoft.com...
> Ive got a box that is having bizarre performance behavior. There is plenty
> of
> CPU and RAM available. There is no blocking. I cannot find any table
> scans,
> (other than - - 120 row temp table scans) nor does the Index Tuning Wizrd
> recommend that I add anything. No software other than SQL Server and some
> CommVault backup software are on the box. But still, performance is all
> over
> the place. Sometimes everything is humming right along between 3 and 5
> seconds, but later on it will be between 40 and 50 seconds. Of course I
> see
> all of these Procs in Profiler, but everything appears to be OK with them.
> Ive been on this all day and am really at a loss as to what to do from
> here.
> Any ideas?
> --
> TIA,
> ChrisR|||ChrisR wrote:
> Ive got a box that is having bizarre performance behavior. There is
> plenty of CPU and RAM available. There is no blocking. I cannot find
> any table scans, (other than - - 120 row temp table scans) nor does
> the Index Tuning Wizrd recommend that I add anything. No software
> other than SQL Server and some CommVault backup software are on the
> box. But still, performance is all over the place. Sometimes
> everything is humming right along between 3 and 5 seconds, but later
> on it will be between 40 and 50 seconds. Of course I see all of these
> Procs in Profiler, but everything appears to be OK with them. Ive
> been on this all day and am really at a loss as to what to do from
> here. Any ideas?
When you say the procs, as they appear in Profiler, appear ok, what do
you mean? If they are in fact appearing within your expected performance
parameters, you should see CPU, Reads, and Duration figures that are
normal. Duration should be in the 3,000 - 5,000ms range as you mentioned
and in all likelyhood, performance at the client should be good as well.
If OTOH you are seeing a Duration of 30,000ms or elevated CPU or Read
activity, then I'm guessing that Profiler is showing you there is a
problem.
Can you be more specific about any differences in the Profiler output
between good and bad performance.
David Gugick
Quest Software
www.imceda.com
www.quest.com
bizarre performance issue
CPU and RAM available. There is no blocking. I cannot find any table scans,
(other than - - 120 row temp table scans) nor does the Index Tuning Wizrd
recommend that I add anything. No software other than SQL Server and some
CommVault backup software are on the box. But still, performance is all over
the place. Sometimes everything is humming right along between 3 and 5
seconds, but later on it will be between 40 and 50 seconds. Of course I see
all of these Procs in Profiler, but everything appears to be OK with them.
Ive been on this all day and am really at a loss as to what to do from here.
Any ideas?
TIA,
ChrisR
That is not much to go on. What is it you are doing? 3 to 5 seconds isn't
humming along in my book but it is hard to say without seeing what you are
trying to do. No that it should make that much of a difference but maybe
you are getting a lot of recompiles due to the temp table populations. Have
you tried replacing them with table vars? They sound like the optimal size
for table vars over temp tables.
Andrew J. Kelly SQL MVP
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:594022ED-21B3-44F6-84A3-803F877D243D@.microsoft.com...
> Ive got a box that is having bizarre performance behavior. There is plenty
> of
> CPU and RAM available. There is no blocking. I cannot find any table
> scans,
> (other than - - 120 row temp table scans) nor does the Index Tuning Wizrd
> recommend that I add anything. No software other than SQL Server and some
> CommVault backup software are on the box. But still, performance is all
> over
> the place. Sometimes everything is humming right along between 3 and 5
> seconds, but later on it will be between 40 and 50 seconds. Of course I
> see
> all of these Procs in Profiler, but everything appears to be OK with them.
> Ive been on this all day and am really at a loss as to what to do from
> here.
> Any ideas?
> --
> TIA,
> ChrisR
|||ChrisR wrote:
> Ive got a box that is having bizarre performance behavior. There is
> plenty of CPU and RAM available. There is no blocking. I cannot find
> any table scans, (other than - - 120 row temp table scans) nor does
> the Index Tuning Wizrd recommend that I add anything. No software
> other than SQL Server and some CommVault backup software are on the
> box. But still, performance is all over the place. Sometimes
> everything is humming right along between 3 and 5 seconds, but later
> on it will be between 40 and 50 seconds. Of course I see all of these
> Procs in Profiler, but everything appears to be OK with them. Ive
> been on this all day and am really at a loss as to what to do from
> here. Any ideas?
When you say the procs, as they appear in Profiler, appear ok, what do
you mean? If they are in fact appearing within your expected performance
parameters, you should see CPU, Reads, and Duration figures that are
normal. Duration should be in the 3,000 - 5,000ms range as you mentioned
and in all likelyhood, performance at the client should be good as well.
If OTOH you are seeing a Duration of 30,000ms or elevated CPU or Read
activity, then I'm guessing that Profiler is showing you there is a
problem.
Can you be more specific about any differences in the Profiler output
between good and bad performance.
David Gugick
Quest Software
www.imceda.com
www.quest.com