Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Tuesday, March 20, 2012

Check for Null values in Transact Sql

I am using Visual Web Developer Express 2005 and SQL Server Express 2005.

I have set up a trigger that fires when an update has been performed on
a specific table. The trigger checks to see if specific columns have
been updated. If they have, then the trigger code is executed. This part
works fine.

I am now trying to find a way to check if null values exist in either
one of two field from the same table. If either field contains a null
value, then I don't want the trigger code to be executed.

How can I check for null values and skip a block of code within my
Transact Sql trigger.

Thanks....

You can use the IS NULL clause to test a column...

|||

Use something like:

if exists (select * from MyTbl where Col1 is null or Col2 is null)

//do not update

else //update

Thursday, March 8, 2012

Check checkboxes

Hi,

I have two web pages in one web page i have 5 check boxes. For example if the user checks the Checkbox1, checkbox2 and clicks on button.

On the button click I am storing the selected checkboxes value in database lke the following:

Year Options

xxx 1

xxx 2

in the above format( user selectes checbox1, check box 2).

And in the Second Web page I am showing the 5 checkboxes but in this web page I need to check the first and second checkboxes on the page load because user selectes those two check boxes in the first web page.

my select query returning the results like this:

Options

1

2

based on options I have to check those corresponding check boxes in the second web page.

How to achive this.

Thanks in advance

Saving a user's CheckBoxList selection and re-populating the CheckBoxList from saved data:http://www.mikesdotnetting.com/Article.aspx?ArticleID=53

|||

Hello,

You need to loop thru your result set and set the checkboex to Checked on Page_Load event.

For example:

This is how you get the values and set the checkboxes to Checked.

SqlCommand cmd = new SqlCommand("Select OPtions from <Yourtable>...");

SqlDataReader reader =cmd.ExecuteReader();while( reader.Read())

{

int col = reader.GetOrdinal("Options");

int checkValue = reader.GetInt32(col);switch(checkValue)

{

case 1:

CheckBox1.Checked =true;

case 2:

CheckBox2.Checked =true;

... etc

}

}

Optionaly you can use Page.FindControl() method to get to the checkboxes (instead of using switch statement). The problem with that is that FindControl does not loop thru the Page hierarchy so if you page is complex you may have to write your own FindControl method.

Once you have that method you can call it from the Page_Load event, like this:

if (!IsPostback)
{

// Call the SetCheckBoxes method here ...

}

Hope this helps

regards,

G

Saturday, February 25, 2012

Chart trend line

Good day,
I hope some one can help. In the past I have used OWC to create much charts
for the web but now see the light and have started to use SSRS. Only on thing
though, is it possible for a SSRS chart to have trend lines. It is critical
that I have trend lines in my chart, what the MD wants the MS gets.
Any one know if this is possible and how to do it'
RegardsAre you talking about showing markers and plot data as a line? If so: right
click the graph, click properties, select Data tab, select the value, click
edit and select Appearance tab. Here you have show markers and plot data as
line options.
"PLSH" wrote:
> Good day,
> I hope some one can help. In the past I have used OWC to create much charts
> for the web but now see the light and have started to use SSRS. Only on thing
> though, is it possible for a SSRS chart to have trend lines. It is critical
> that I have trend lines in my chart, what the MD wants the MS gets.
> Any one know if this is possible and how to do it'
> Regards|||Nope, I mean a trend line. I have a chart that is a simple line chart and I
need to have a trend line for each of the fields. You can do it with OWC
which is what I am converting my charts from.
"Eduardo Luczinski" wrote:
> Are you talking about showing markers and plot data as a line? If so: right
> click the graph, click properties, select Data tab, select the value, click
> edit and select Appearance tab. Here you have show markers and plot data as
> line options.
> "PLSH" wrote:
> > Good day,
> >
> > I hope some one can help. In the past I have used OWC to create much charts
> > for the web but now see the light and have started to use SSRS. Only on thing
> > though, is it possible for a SSRS chart to have trend lines. It is critical
> > that I have trend lines in my chart, what the MD wants the MS gets.
> >
> > Any one know if this is possible and how to do it'
> >
> > Regards

Sunday, February 19, 2012

Chart formatting and non breaking spaces

Hi all,

I'm having a problem and I cannot seem to find how to fix this anywhere on the web.

I have a stacked bar chart with my data labels showing down the x axis. My client wants me to put a bit of white space between the label and the actual chart. So I tried adding spaces to my data label but of course RS thinks they don't exist since they are not non breaking spaces.

How can I do the following in my chart label

=Fields!Myfield.Value & " "

As you can see I want to add a couple of spaces to my data label. I can't use &nbsp;, all the ampersands get confused. I tried & char(32) but RS doesn't like char(n). I tried ChrW(160) [I saw this in the web somewhere] but this didn't work either.

Is there anything I can do?

thanks in advance, I'm at my wits end (again)

Annabel

Try Chr(160).|||thanks but this made no difference....We have told the client we can't add spaces between the label and the axis, they are ok with it.

Chart formatting and non breaking spaces

Hi all,

I'm having a problem and I cannot seem to find how to fix this anywhere on the web.

I have a stacked bar chart with my data labels showing down the x axis. My client wants me to put a bit of white space between the label and the actual chart. So I tried adding spaces to my data label but of course RS thinks they don't exist since they are not non breaking spaces.

How can I do the following in my chart label

=Fields!Myfield.Value & " "

As you can see I want to add a couple of spaces to my data label. I can't use &nbsp;, all the ampersands get confused. I tried & char(32) but RS doesn't like char(n). I tried ChrW(160) [I saw this in the web somewhere] but this didn't work either.

Is there anything I can do?

thanks in advance, I'm at my wits end (again)

Annabel

Try Chr(160).|||thanks but this made no difference....We have told the client we can't add spaces between the label and the axis, they are ok with it.

Chart formatting and non breaking spaces

Hi all,

I'm having a problem and I cannot seem to find how to fix this anywhere on the web.

I have a stacked bar chart with my data labels showing down the x axis. My client wants me to put a bit of white space between the label and the actual chart. So I tried adding spaces to my data label but of course RS thinks they don't exist since they are not non breaking spaces.

How can I do the following in my chart label

=Fields!Myfield.Value & " "

As you can see I want to add a couple of spaces to my data label. I can't use &nbsp;, all the ampersands get confused. I tried & char(32) but RS doesn't like char(n). I tried ChrW(160) [I saw this in the web somewhere] but this didn't work either.

Is there anything I can do?

thanks in advance, I'm at my wits end (again)

Annabel

Try Chr(160).|||thanks but this made no difference....We have told the client we can't add spaces between the label and the axis, they are ok with it.

Chart does not show up untill cookies allowed

We have web server with web application on one server and SQL Server with
Reporting Services on another. We try to implement reporting on internet, but
for some reason charts in reports not displayed untill cookies from Reporting
Services server (not web server) on client side are not enabled.
Does anubody has solution or ideas?
ThanksI found the solution. The value for UseSessionCookies was "true", I changed
it to "false" (in Configuration table).

Friday, February 10, 2012

Changing URL's for Reporting Services

I have installed reporting services by default into the default web site in
IIS. (I'm running Windows Server 2003) and need to move this to a branded
URL...Is my only option to uninstall/reinstall? I can take care of setting
IIS to the new URL...however what is the proper method of moving the Virtual
Directories that Reporting services installed.
Thanks
--
Report DeveloperHave you heard about the concept of URL rewriting?
You can use custom httpmodules or httphandlers to achieve you goal, or just
simply write custom web app's error 401 page.
"Matt" <Matt@.discussions.microsoft.com> wrote in message
news:F206573B-9F9A-437F-BA07-3C284F329137@.microsoft.com...
>I have installed reporting services by default into the default web site in
> IIS. (I'm running Windows Server 2003) and need to move this to a branded
> URL...Is my only option to uninstall/reinstall? I can take care of
> setting
> IIS to the new URL...however what is the proper method of moving the
> Virtual
> Directories that Reporting services installed.
> Thanks
> --
> Report Developer