Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Thursday, March 22, 2012

Error in using Multi varied parameters!

Hi,

I am tired of troubleshooting this. If I use sa MVP called say states and on the top of the page write

Parameters!orgstate.Value

I get the faSadmiliar "#Error" message. This works fine for any other parameter except MVP.? Anything that i am forgetting to do?

Let me know ASAP if anyone has an idea about this.

Thanks

Because it is a multi-value parameter you are getting back an array of values. You need to do something like:

Parameters!orgstate.Value(0)

-Daniel

|||

Once you mark a parameter as "multi-value", the .Value property will return an object[] with all selected values. If only one value is selected, it will be an object array of length = 1. Object arrays cannot be directly compared with Strings.

To access individual values of a multi value parameter you can use expressions like this:
=Parameters!MVP1.IsMultiValue
boolean flag - tells if a parameter is defined as multi value
=Parameters!MVP1.Count
returns the number of values in the array
=Parameters!MVP1.Value(0)
returns the first selected value
=Join(Parameters!MVP1.Value)
creates a space separated list of values
=Join(Parameters!MVP1.Value, ", ")
creates a comma separated list of values
=Split("a b c", " ")
to create a multi value object array from a string (this can be used e.g. for drillthrough parameters, subreports, or query parameters)

See also MSDN:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctjoin.asp
* http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctsplit.asp

-- Robert

|||

Thanks Daniel!

Error in using Multi varied parameters!

Hi,

I am tired of troubleshooting this. If I use sa MVP called say states and on the top of the page write

Parameters!orgstate.Value

I get the faSadmiliar "#Error" message. This works fine for any other parameter except MVP.? Anything that i am forgetting to do?

Let me know ASAP if anyone has an idea about this.

Thanks

Because it is a multi-value parameter you are getting back an array of values. You need to do something like:

Parameters!orgstate.Value(0)

-Daniel

|||

Once you mark a parameter as "multi-value", the .Value property will return an object[] with all selected values. If only one value is selected, it will be an object array of length = 1. Object arrays cannot be directly compared with Strings.

To access individual values of a multi value parameter you can use expressions like this:
=Parameters!MVP1.IsMultiValue
boolean flag - tells if a parameter is defined as multi value
=Parameters!MVP1.Count
returns the number of values in the array
=Parameters!MVP1.Value(0)
returns the first selected value
=Join(Parameters!MVP1.Value)
creates a space separated list of values
=Join(Parameters!MVP1.Value, ", ")
creates a comma separated list of values
=Split("a b c", " ")
to create a multi value object array from a string (this can be used e.g. for drillthrough parameters, subreports, or query parameters)

See also MSDN:
* http://msdn.microsoft.com/library/en-us/vblr7/html/vafctjoin.asp
* http://msdn.microsoft.com/library/en-us/vbenlr98/html/vafctsplit.asp

-- Robert

|||

Thanks Daniel!

Wednesday, March 21, 2012

Error in sql open statement

Hi,
I am new to sql server. I am trying to open a asp page by connecting to a
sql server database. The sql statement is coming correct. However I am
getting the following error:
ADODB.Connection (0x800A0E79)
Operation is not allowed when the object is open.
The error is happening to the following line of the code
conn.Open strSQL
Any help is appreciated here. Thanks.
CODE:
<!-- #include file="adovbs.inc" -->
<%
set conn = Server.CreateObject("ADODB.Connection")
set cmd = Server.CreateObject("ADODB.Command")
sConnString = "Provider=SQLOLEDB.1;User ID=sa;password=abcde;Initial
Catalog=manpowerweb;Data Source = DOJHLNBCC-003;Use Procedure for
Prepare=1;Auto Translate=True;Packet Size=4096"
Conn.Open sConnString
Set cmd.ActiveConnection = Conn
dim strSQL
UserID = request.Form("UserID")
Passwd = request.Form("password")
FirstName = request.Form("FirstName")
LastName = request.Form("LastName")
AgencyName = request.Form("AgencyName")
EmailAddress = request.Form("emailAddress")
PhoneNumber = Request.Form("PhoneNumber")
strcurrentdate = "'" & year(date) & "/" & month(date) & "/" & day(date) &
" " & hour(Now()) & ":" & minute(Now()) & ":" & second(Now()) & "'"
strSQL = "INSERT INTO tblApplicant (ApplicantUserID, ApplicantPassword,
ApplicantFirstName, ApplicantLastName, "
strSQL = strSQL & "ApplicantEmailAddress, ApplicantAgencyText,
ApplicantPhoneNumber, "
strSQL = strSQL & "ApplicantSysCreateDate, ApplicantSysModDate) "
strSQL = strSQL & "VALUES ('" & UserID & "', '" & passwd & "', '"
strSQL = strSQL & FirstName & "', '" & LastName & "', '" & EmailAddress &
"', '"
strSQL = strSQL & AgencyName & "', '" & PhoneNumber & "', '"
strSQL = strSQL & strcurrentdate & ", " & strcurrentdate & ")"
response.write strSQL & vbCRLF
'Response.end
Response.Write "This is before the execution of the sql statement" & "<br>"
conn.Open strSQL
Response.Write "This is after the execution of the sql statement" & "<br>"
%>> conn.Open strSQL
The Open method of an ADO Connection object expects a connection string, not
a SQL statement. You can use the Execute method to execute a SQL statement:
conn.Open strConnectionString
conn.Execute strSQL
conn.Close
Hope this helps.
Dan Guzman
SQL Server MVP
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:B901C4EE-D0CF-4C75-8CA8-823DE4BFF517@.microsoft.com...
> Hi,
> I am new to sql server. I am trying to open a asp page by connecting to a
> sql server database. The sql statement is coming correct. However I am
> getting the following error:
> ADODB.Connection (0x800A0E79)
> Operation is not allowed when the object is open.
> The error is happening to the following line of the code
> conn.Open strSQL
> Any help is appreciated here. Thanks.
> CODE:
> <!-- #include file="adovbs.inc" -->
> <%
> set conn = Server.CreateObject("ADODB.Connection")
> set cmd = Server.CreateObject("ADODB.Command")
>
> sConnString = "Provider=SQLOLEDB.1;User ID=sa;password=abcde;Initial
> Catalog=manpowerweb;Data Source = DOJHLNBCC-003;Use Procedure for
> Prepare=1;Auto Translate=True;Packet Size=4096"
>
> Conn.Open sConnString
> Set cmd.ActiveConnection = Conn
> dim strSQL
>
> UserID = request.Form("UserID")
> Passwd = request.Form("password")
> FirstName = request.Form("FirstName")
> LastName = request.Form("LastName")
> AgencyName = request.Form("AgencyName")
> EmailAddress = request.Form("emailAddress")
> PhoneNumber = Request.Form("PhoneNumber")
>
>
> strcurrentdate = "'" & year(date) & "/" & month(date) & "/" & day(date) &
> " " & hour(Now()) & ":" & minute(Now()) & ":" & second(Now()) & "'"
> strSQL = "INSERT INTO tblApplicant (ApplicantUserID, ApplicantPassword,
> ApplicantFirstName, ApplicantLastName, "
> strSQL = strSQL & "ApplicantEmailAddress, ApplicantAgencyText,
> ApplicantPhoneNumber, "
> strSQL = strSQL & "ApplicantSysCreateDate, ApplicantSysModDate) "
> strSQL = strSQL & "VALUES ('" & UserID & "', '" & passwd & "', '"
> strSQL = strSQL & FirstName & "', '" & LastName & "', '" & EmailAddress &
> "', '"
> strSQL = strSQL & AgencyName & "', '" & PhoneNumber & "', '"
> strSQL = strSQL & strcurrentdate & ", " & strcurrentdate & ")"
> response.write strSQL & vbCRLF
> 'Response.end
> Response.Write "This is before the execution of the sql statement" &
> "<br>"
> conn.Open strSQL
> Response.Write "This is after the execution of the sql statement" & "<br>"
> %>
>

error in sql

Sir,
I encounter the error page when tried to display the
data from northwind database in a datagrid in aspx
application. The error page I get is as follows:
server error in '/myview' application
Login failed for user 'NT Authority\Network Service'
Exception details :System.Data.SqlClient.SqlException:
Login failed for user 'NT Authority\Network Service'
Please give a good solution for this.
I'm using sql server 2000 in .net 2003 serverThe most complete resource on securing asp.net when working with SQL
Server is the best practices whitepaper, which you can download at
http://www.microsoft.com/downloads/release.asp?ReleaseID=44047. It
sounds like you have system instead of machine specified as the
processmodel element (a security no-no). Open the Machine.config file
in Notepad and change the userName attribute to MACHINE. Save and then
enable the ASPNET account in SQL Server and grant it membership in any
roles you need.
-- Mary
MCW Technologies
http://www.mcwtech.com
On Tue, 13 Jan 2004 03:50:11 -0800, "ramadevi"
<anonymous@.discussions.microsoft.com> wrote:
>Sir,
> I encounter the error page when tried to display the
>data from northwind database in a datagrid in aspx
>application. The error page I get is as follows:
> server error in '/myview' application
> Login failed for user 'NT Authority\Network Service'
>Exception details :System.Data.SqlClient.SqlException:
> Login failed for user 'NT Authority\Network Service'
>
>Please give a good solution for this.
> I'm using sql server 2000 in .net 2003 server

Monday, March 19, 2012

error in sql

Sir,
I encounter the error page when tried to display the
data from northwind database in a datagrid in aspx
application. The error page I get is as follows:
server error in '/myview' application
Login failed for user 'NT Authority\Network Service'
Exception details :System.Data.SqlClient.SqlException:
Login failed for user 'NT Authority\Network Service'
Please give a good solution for this.
I'm using sql server 2000 in .net 2003 serverThe most complete resource on securing asp.net when working with SQL
Server is the best practices whitepaper, which you can download at
http://www.microsoft.com/downloads/...eleaseID=44047. It
sounds like you have system instead of machine specified as the
processmodel element (a security no-no). Open the Machine.config file
in Notepad and change the userName attribute to MACHINE. Save and then
enable the ASPNET account in SQL Server and grant it membership in any
roles you need.
-- Mary
MCW Technologies
http://www.mcwtech.com
On Tue, 13 Jan 2004 03:50:11 -0800, "ramadevi"
<anonymous@.discussions.microsoft.com> wrote:
quote:

>Sir,
> I encounter the error page when tried to display the
>data from northwind database in a datagrid in aspx
>application. The error page I get is as follows:
> server error in '/myview' application
> Login failed for user 'NT Authority\Network Service'
>Exception details :System.Data.SqlClient.SqlException:
> Login failed for user 'NT Authority\Network Service'
>
>Please give a good solution for this.
> I'm using sql server 2000 in .net 2003 server

Friday, March 9, 2012

Error in master.dbo.sysindexes

Hi!
This command:
DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
go
yields:
Page (1:396), object ID 2, index ID 0 has been modified but is not marked
modified in the differential backup bitmap.
CHECKTABLE found 0 allocation errors and 1 consistency errors in table
'sysindexes' (object ID 2).
repair_allow_data_loss is the minimum repair level for the errors found by
DBCC CHECKTABLE (master.dbo.sysindexes ).
I would like to identify the troubled index and perhaps delete it and
recreate it to see if this will go away.
--returns 43 rows
select * from sysindexes where indid = 0
--returns 0 rows
select * from sysindexes where indid = 0 and id=2
--returns 1 row where name='sysindexes'
select * from sysobjects where id=2
What exactly do "object ID 2" and "index ID 0" in the error message refer
to?
Thanks,
JimHave you considered contacting Microsoft for this? As this sounds like a
possible corruption issue, I would contact PSS.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Jim" <please.reply@.group> wrote in message
news:OmP9xkDpGHA.4408@.TK2MSFTNGP04.phx.gbl...
Hi!
This command:
DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
go
yields:
Page (1:396), object ID 2, index ID 0 has been modified but is not marked
modified in the differential backup bitmap.
CHECKTABLE found 0 allocation errors and 1 consistency errors in table
'sysindexes' (object ID 2).
repair_allow_data_loss is the minimum repair level for the errors found by
DBCC CHECKTABLE (master.dbo.sysindexes ).
I would like to identify the troubled index and perhaps delete it and
recreate it to see if this will go away.
--returns 43 rows
select * from sysindexes where indid = 0
--returns 0 rows
select * from sysindexes where indid = 0 and id=2
--returns 1 row where name='sysindexes'
select * from sysobjects where id=2
What exactly do "object ID 2" and "index ID 0" in the error message refer
to?
Thanks,
Jim|||Hi Jim
Object ID 2 is the sysindexes table, and index ID 0 means the table itself,
not an index on sysindexes.
So there is no 'troubled index' that you can just drop. The problem is in
the sysindexes table itself, which keeps track of all your indexes in a
database, all the statistics, and points to the structures that keep track
of space used for all tables and indexes, in other words, this is a very
critical table and any corruption in it can impact everything else in the
database.
If you have a good recent backup of the database, you can try running DBCC
CHECKTABLE with repair_allow_data_loss, but read all about it before you run
it.
Or you might just decide to pay the fee and call Microsoft support.
--
HTH
Kalen Delaney, SQL Server MVP
"Jim" <please.reply@.group> wrote in message
news:OmP9xkDpGHA.4408@.TK2MSFTNGP04.phx.gbl...
> Hi!
> This command:
> DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
> go
> yields:
> Page (1:396), object ID 2, index ID 0 has been modified but is not marked
> modified in the differential backup bitmap.
> CHECKTABLE found 0 allocation errors and 1 consistency errors in table
> 'sysindexes' (object ID 2).
> repair_allow_data_loss is the minimum repair level for the errors found by
> DBCC CHECKTABLE (master.dbo.sysindexes ).
> I would like to identify the troubled index and perhaps delete it and
> recreate it to see if this will go away.
> --returns 43 rows
> select * from sysindexes where indid = 0
> --returns 0 rows
> select * from sysindexes where indid = 0 and id=2
> --returns 1 row where name='sysindexes'
> select * from sysobjects where id=2
> What exactly do "object ID 2" and "index ID 0" in the error message refer
> to?
> Thanks,
> Jim
>|||Vyas,
Thank you for the reply.
Jim
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:eUMcopDpGHA.1548@.TK2MSFTNGP04.phx.gbl...
> Have you considered contacting Microsoft for this? As this sounds like a
> possible corruption issue, I would contact PSS.
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Jim" <please.reply@.group> wrote in message
> news:OmP9xkDpGHA.4408@.TK2MSFTNGP04.phx.gbl...
> Hi!
> This command:
> DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
> go
> yields:
> Page (1:396), object ID 2, index ID 0 has been modified but is not marked
> modified in the differential backup bitmap.
> CHECKTABLE found 0 allocation errors and 1 consistency errors in table
> 'sysindexes' (object ID 2).
> repair_allow_data_loss is the minimum repair level for the errors found by
> DBCC CHECKTABLE (master.dbo.sysindexes ).
> I would like to identify the troubled index and perhaps delete it and
> recreate it to see if this will go away.
> --returns 43 rows
> select * from sysindexes where indid = 0
> --returns 0 rows
> select * from sysindexes where indid = 0 and id=2
> --returns 1 row where name='sysindexes'
> select * from sysobjects where id=2
> What exactly do "object ID 2" and "index ID 0" in the error message refer
> to?
> Thanks,
> Jim
>
>|||Kalen,
I have taken your advice:
DBCC CHECKTABLE (master, repair_allow_data_loss)
The table now shows no errors. I have backed up the repaired table and will
monitor it.
Thanks!
Jim
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:eMedHwDpGHA.4848@.TK2MSFTNGP03.phx.gbl...
> Hi Jim
> Object ID 2 is the sysindexes table, and index ID 0 means the table
> itself, not an index on sysindexes.
> So there is no 'troubled index' that you can just drop. The problem is in
> the sysindexes table itself, which keeps track of all your indexes in a
> database, all the statistics, and points to the structures that keep track
> of space used for all tables and indexes, in other words, this is a very
> critical table and any corruption in it can impact everything else in the
> database.
> If you have a good recent backup of the database, you can try running DBCC
> CHECKTABLE with repair_allow_data_loss, but read all about it before you
> run it.
> Or you might just decide to pay the fee and call Microsoft support.
> --
> HTH
> Kalen Delaney, SQL Server MVP
>
> "Jim" <please.reply@.group> wrote in message
> news:OmP9xkDpGHA.4408@.TK2MSFTNGP04.phx.gbl...
>> Hi!
>> This command:
>> DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
>> go
>> yields:
>> Page (1:396), object ID 2, index ID 0 has been modified but is not marked
>> modified in the differential backup bitmap.
>> CHECKTABLE found 0 allocation errors and 1 consistency errors in table
>> 'sysindexes' (object ID 2).
>> repair_allow_data_loss is the minimum repair level for the errors found
>> by DBCC CHECKTABLE (master.dbo.sysindexes ).
>> I would like to identify the troubled index and perhaps delete it and
>> recreate it to see if this will go away.
>> --returns 43 rows
>> select * from sysindexes where indid = 0
>> --returns 0 rows
>> select * from sysindexes where indid = 0 and id=2
>> --returns 1 row where name='sysindexes'
>> select * from sysobjects where id=2
>> What exactly do "object ID 2" and "index ID 0" in the error message refer
>> to?
>> Thanks,
>> Jim
>|||There was nothing wrong with the sysindexes table per se - the problem was
with the diff map (the bitmap the shows which extents need to be included in
the next differential backup). A page in sysindexes had been altered since
the last diff backup but the corresponding bit for the extent containing the
page wasn't set in the diff map.
If you lookup the error number (its error 2515) in MSDN
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_reslsyserr_1_3qwp.asp)
you'll see an explanation and what you need to be aware of if you've run
repair (that you need to take a full backup before diff backups are possible
again)
Thanks
--
Paul Randal
Lead Program Manager, Microsoft SQL Server Storage Engine
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jim" <please.reply@.group> wrote in message
news:OcDK4wEpGHA.1440@.TK2MSFTNGP03.phx.gbl...
> Kalen,
> I have taken your advice:
> DBCC CHECKTABLE (master, repair_allow_data_loss)
> The table now shows no errors. I have backed up the repaired table and
> will monitor it.
> Thanks!
> Jim
>
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:eMedHwDpGHA.4848@.TK2MSFTNGP03.phx.gbl...
>> Hi Jim
>> Object ID 2 is the sysindexes table, and index ID 0 means the table
>> itself, not an index on sysindexes.
>> So there is no 'troubled index' that you can just drop. The problem is in
>> the sysindexes table itself, which keeps track of all your indexes in a
>> database, all the statistics, and points to the structures that keep
>> track of space used for all tables and indexes, in other words, this is a
>> very critical table and any corruption in it can impact everything else
>> in the database.
>> If you have a good recent backup of the database, you can try running
>> DBCC CHECKTABLE with repair_allow_data_loss, but read all about it before
>> you run it.
>> Or you might just decide to pay the fee and call Microsoft support.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Jim" <please.reply@.group> wrote in message
>> news:OmP9xkDpGHA.4408@.TK2MSFTNGP04.phx.gbl...
>> Hi!
>> This command:
>> DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
>> go
>> yields:
>> Page (1:396), object ID 2, index ID 0 has been modified but is not
>> marked modified in the differential backup bitmap.
>> CHECKTABLE found 0 allocation errors and 1 consistency errors in table
>> 'sysindexes' (object ID 2).
>> repair_allow_data_loss is the minimum repair level for the errors found
>> by DBCC CHECKTABLE (master.dbo.sysindexes ).
>> I would like to identify the troubled index and perhaps delete it and
>> recreate it to see if this will go away.
>> --returns 43 rows
>> select * from sysindexes where indid = 0
>> --returns 0 rows
>> select * from sysindexes where indid = 0 and id=2
>> --returns 1 row where name='sysindexes'
>> select * from sysobjects where id=2
>> What exactly do "object ID 2" and "index ID 0" in the error message
>> refer to?
>> Thanks,
>> Jim
>>
>|||Paul,
Thank you for the pointer!
Jim
"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message
news:ugOopBSpGHA.756@.TK2MSFTNGP05.phx.gbl...
> There was nothing wrong with the sysindexes table per se - the problem was
> with the diff map (the bitmap the shows which extents need to be included
> in the next differential backup). A page in sysindexes had been altered
> since the last diff backup but the corresponding bit for the extent
> containing the page wasn't set in the diff map.
> If you lookup the error number (its error 2515) in MSDN
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_reslsyserr_1_3qwp.asp)
> you'll see an explanation and what you need to be aware of if you've run
> repair (that you need to take a full backup before diff backups are
> possible again)
> Thanks
> --
> Paul Randal
> Lead Program Manager, Microsoft SQL Server Storage Engine
> http://blogs.msdn.com/sqlserverstorageengine/default.aspx
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "Jim" <please.reply@.group> wrote in message
> news:OcDK4wEpGHA.1440@.TK2MSFTNGP03.phx.gbl...
>> Kalen,
>> I have taken your advice:
>> DBCC CHECKTABLE (master, repair_allow_data_loss)
>> The table now shows no errors. I have backed up the repaired table and
>> will monitor it.
>> Thanks!
>> Jim
>>
>> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
>> news:eMedHwDpGHA.4848@.TK2MSFTNGP03.phx.gbl...
>> Hi Jim
>> Object ID 2 is the sysindexes table, and index ID 0 means the table
>> itself, not an index on sysindexes.
>> So there is no 'troubled index' that you can just drop. The problem is
>> in the sysindexes table itself, which keeps track of all your indexes in
>> a database, all the statistics, and points to the structures that keep
>> track of space used for all tables and indexes, in other words, this is
>> a very critical table and any corruption in it can impact everything
>> else in the database.
>> If you have a good recent backup of the database, you can try running
>> DBCC CHECKTABLE with repair_allow_data_loss, but read all about it
>> before you run it.
>> Or you might just decide to pay the fee and call Microsoft support.
>> --
>> HTH
>> Kalen Delaney, SQL Server MVP
>>
>> "Jim" <please.reply@.group> wrote in message
>> news:OmP9xkDpGHA.4408@.TK2MSFTNGP04.phx.gbl...
>> Hi!
>> This command:
>> DBCC CHECKTABLE (sysindexes) WITH NO_INFOMSGS
>> go
>> yields:
>> Page (1:396), object ID 2, index ID 0 has been modified but is not
>> marked modified in the differential backup bitmap.
>> CHECKTABLE found 0 allocation errors and 1 consistency errors in table
>> 'sysindexes' (object ID 2).
>> repair_allow_data_loss is the minimum repair level for the errors found
>> by DBCC CHECKTABLE (master.dbo.sysindexes ).
>> I would like to identify the troubled index and perhaps delete it and
>> recreate it to see if this will go away.
>> --returns 43 rows
>> select * from sysindexes where indid = 0
>> --returns 0 rows
>> select * from sysindexes where indid = 0 and id=2
>> --returns 1 row where name='sysindexes'
>> select * from sysobjects where id=2
>> What exactly do "object ID 2" and "index ID 0" in the error message
>> refer to?
>> Thanks,
>> Jim
>>
>>
>

Wednesday, March 7, 2012

Error in Hiding Report Item

Hi,
I am trying to show the textbox depending on the page numbers in Page
Footer. But, I get the following error in doing so
Expression in Visibility section of Textbox:
IIF(Globals!PageNumber>1,true,false)
Error: The hidden expression for the textbox 'textbox400' has the value
"IIF(Globals!PageNumber>1,true,false)", which is not a valid Boolean value.
Can someone help me with this
Thanks
Ponnurangamexpressions should begin with "="
i.e.
=IIF(Globals!PageNumber>1,true,false)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ponnurangam" <ponnurangam@.trellisys.net> wrote in message
news:OGwmayVmEHA.412@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I am trying to show the textbox depending on the page numbers in Page
> Footer. But, I get the following error in doing so
> Expression in Visibility section of Textbox:
> IIF(Globals!PageNumber>1,true,false)
> Error: The hidden expression for the textbox 'textbox400' has the value
> "IIF(Globals!PageNumber>1,true,false)", which is not a valid Boolean
> value.
> Can someone help me with this
> Thanks
> Ponnurangam
>|||Try enclosing the TRUE and FALSE statements in double quotes (").
"Ponnurangam" <ponnurangam@.trellisys.net> wrote in message news:<OGwmayVmEHA.412@.TK2MSFTNGP10.phx.gbl>...
> Hi,
> I am trying to show the textbox depending on the page numbers in Page
> Footer. But, I get the following error in doing so
> Expression in Visibility section of Textbox:
> IIF(Globals!PageNumber>1,true,false)
> Error: The hidden expression for the textbox 'textbox400' has the value
> "IIF(Globals!PageNumber>1,true,false)", which is not a valid Boolean value.
> Can someone help me with this
> Thanks
> Ponnurangam|||Sorry, i read this error wrong. Do you have an equals (=) sign in
front of the expression? i tried what you did, and it works fine for
me.
=iif(Globals!PageNumber>1,TRUE,FALSE)
"Ponnurangam" <ponnurangam@.trellisys.net> wrote in message news:<OGwmayVmEHA.412@.TK2MSFTNGP10.phx.gbl>...
> Hi,
> I am trying to show the textbox depending on the page numbers in Page
> Footer. But, I get the following error in doing so
> Expression in Visibility section of Textbox:
> IIF(Globals!PageNumber>1,true,false)
> Error: The hidden expression for the textbox 'textbox400' has the value
> "IIF(Globals!PageNumber>1,true,false)", which is not a valid Boolean value.
> Can someone help me with this
> Thanks
> Ponnurangam

Friday, February 17, 2012

Error Handling with SQLDataSource

Hello to all

I am having a SQLDataSource on my web page to connect with database. Now If it generates any error then where to capture that errors ?? Means at which place(which event or any other place) should i write code for handeling errors ?

Which programming language (e.g. C#) do you use for your web page? In C#, you can use a 'try...catch' block to catch the exception when connect to SQLDataSource; you can perform the connection action in a 'button click' event or in page load event as you like.|||

Yes I know in C# I can use Try--catch. But on which event Do I use Try and Catct ?

If I use this on "selecting " it does not have any effect...

|||Yeah im also wondering how to do this.

The sql data source is loaded when the page loads and runs the select command, so it is not run when a button is pressed.|||You can handle the error on the Inserted, Deleted and Updated events. (They all have Exception properties, and if you handle it, you can set ExceptionHandled to true.)|||Hi,

I have a similar question : How do I handleconnection exceptions ?

mpswaim:

You can handle the error on the Inserted,Deleted and Updated events. (They all have Exception properties, and ifyou handle it, you can set ExceptionHandled to true.)

When the server is unavailable, the exception property of the selected event is null.

Thanks,

Loïc