Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts

Monday, March 19, 2012

datareader problem

Hi,

I cant seem to get this working right...I have a datareader which i loop through...i want to test each value to see if its null but i cant get the syntax right.

I know i use dr.item("columnname") or dr(0) to pick a certain column but i dont know the column names and want to check them all anyway. What is the syntax to do this.

Thanks for any help...this is prob very simple but just cant see it.

--------------

While dr.Read

If dr(0)Is System.DBNull.ValueThen

Return"test"

EndIf

EndWhile

I useually would add the following to identify the columns by:

msgbox(dr(0))

msgbox(dr(2)) and so on.

or use response.write(dr(0))

|||

Hi

Ireland:

...i want to test each value to see if its null but i cant get the syntax right.

Ireland,

if i remember right, no VS in front of me, its similar to

while(reader.Read()){// not sure if fields the correct property namefor(int i=0; i < reader.fields.count; i++) {// iterate throu all fields in the rowif(reader[i] ==typeof(string)) {string str = reader[i]; } }}

the correct property you see in the reader intellisence. But i think it was fields

|||

you can try dr.FieldCount. That will give you the number of columns in the datareader.

The code will be something like this (sorry my VB.NET is no good)

While dr.Read
for iCtr=0 to dr.FieldCount
if dr(iCtr) Is System.DBNull.Value Then

Return "test"

End If
Next
End While

Friday, February 24, 2012

DATABASEPROPERTYEX is not a recognized function name?

Hi, I just made a report with the wizard when I swith to preview I got that
message and I cant see my report.
Thanks in advance
--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 3.
MIEMBRO ACTIVO DE ALIANZADEV
http://spaces.msn.com/members/extremed/You are accessing a SQL Server 7.0 or older, correct? Just install SP1 of RS
2000 on report server and report designer machines and it will work.
The workaround for RS 2000 _without_ SP1 is as follows: Go to the "Data
Options" tab of the "Dataset" dialog in report designer. On the Data Options
tab you will see that all settings contain "Auto" (and report server would
therefore try to auto-detect the collation settings from the database
server). Replace the Auto-settings with the following settings (e.g. if your
SQL 7.0 database collation is "SQL_Latin1_General_CP1_CI_AS"):
Collation = Latin1_General
Case sensitivity = false
Kanatype sensitivity = false
Width sensitivity = false
Accent sensitivity = true
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Luis Esteban Valencia" <luisvalen@.haceb.com> wrote in message
news:uCrElYQGFHA.4088@.TK2MSFTNGP09.phx.gbl...
> Hi, I just made a report with the wizard when I swith to preview I got
> that
> message and I cant see my report.
> Thanks in advance
> --
> LUIS ESTEBAN VALENCIA
> MICROSOFT DCE 3.
> MIEMBRO ACTIVO DE ALIANZADEV
> http://spaces.msn.com/members/extremed/
>

DATABASEPROPERTYEX code?

where does DATABASEPROPERTYEX() get its information from? I cant seem to use
sp_helptext to see the code. error "DATABASEPROPERTYEX does not exist in thi
s
database". I checked every db on the server, where does it exist at?
I am tryign to wrte code that checks for recovery level without using the
DATABASEPROPERTYEX function.
thanks in advance!DATABASEPROPERTYEX() is a system function. It's coded as part of the SQL
Server engine, and the code of it not publicly available. What are you
trying to do that prevents you from using DATABASEPROPERTYEX()?
Jacco Schalkwijk
SQL Server MVP
"Carl Henthorn" <CarlHenthorn@.discussions.microsoft.com> wrote in message
news:3D552067-10AD-4023-BAD7-9145BC7A0F02@.microsoft.com...
> where does DATABASEPROPERTYEX() get its information from? I cant seem to
> use
> sp_helptext to see the code. error "DATABASEPROPERTYEX does not exist in
> this
> database". I checked every db on the server, where does it exist at?
> I am tryign to wrte code that checks for recovery level without using the
> DATABASEPROPERTYEX function.
> thanks in advance!|||Many of the properties returned by the DATABASEPROPERTYEX function can
be found in the master.dbo.sysdatabases table, in the status and
status2 columns. The recovery model is dependent on the 'select
into/bulkcopy' and 'trunc. log on chkpt.' database options. However,
it's recommended that you use the DATABASEPROPERTYEX function (instead
of reading from system tables).
Razvan

Friday, February 17, 2012

Database version - can't install SP1

I have a SQL Server 2005 install with the 64-bit Database Server, but
I've had to install the 32-bit version of Reporting Services, since IIS
is running in 32-bit mode. Everything's green in the Configuration
Tool, but when I go to http://server/reportserver, I get the following
error:
The version of the report server database is either in a format that is
not valid, or it cannot be read. The found version is 'C.0.8.43'. The
expected version is 'C.0.8.40'. To continue, update the version of the
report server database and verify access rights.
(rsInvalidReportServerDatabase)
I think the problem is that I have SP1 installed on the 64-bit install,
but it isn't installed on the 32-bit install. However, when I run the
x86 SP1, it doesn't find that I have Reporting Services installed, so
it doesn't update it. I've run the 32-bit and the 64-bit SP1 installer
several times (with reboots!), but to no avail.
Any suggestions? I think I need the SP1 installer to find my
installation of the 32-bit Reporting Services.
Thanks,
CliffeA little more info: If I try to run the 32-bit setup from the original
install CD, it doesn't recognize that anything's installed - it walks
through the wizard from scratch.
If I run ARPWrapper.exe from \Program Files (x86)\Microsoft SQL
Server\90\Setup Bootstrap, it comes up with an error "SQL Server Setup
cannot proceed because the component you have selected has already been
uninstalled. Refer to books online..."
Any suggestions?
Thanks,
Cliffe
cliffeh wrote:
> I have a SQL Server 2005 install with the 64-bit Database Server, but
> I've had to install the 32-bit version of Reporting Services, since IIS
> is running in 32-bit mode. Everything's green in the Configuration
> Tool, but when I go to http://server/reportserver, I get the following
> error:
> The version of the report server database is either in a format that is
> not valid, or it cannot be read. The found version is 'C.0.8.43'. The
> expected version is 'C.0.8.40'. To continue, update the version of the
> report server database and verify access rights.
> (rsInvalidReportServerDatabase)
> I think the problem is that I have SP1 installed on the 64-bit install,
> but it isn't installed on the 32-bit install. However, when I run the
> x86 SP1, it doesn't find that I have Reporting Services installed, so
> it doesn't update it. I've run the 32-bit and the 64-bit SP1 installer
> several times (with reboots!), but to no avail.
> Any suggestions? I think I need the SP1 installer to find my
> installation of the 32-bit Reporting Services.
> Thanks,
> Cliffe