Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

Thursday, March 29, 2012

Cannot export in SSRS 2005

Everytime I try to export a report I get a pop up box to RUN/SAVE/CANCEL Reserved.ReportViewWebControl.axd. Cannot seem to find any relevant issues with this on the web. I lower the security settings on IE and still no diffenrence. Seems to happen with every export type except XML. Any help is greatly appreciated.

PabloThis forum is on .Net Framework (CLR) integration in SQL Server 2005 that allows you to write routines in CLR languages like c#, VB.NET etc.
I suggest posting your question in SQL Server Reporting Services forum to get a faster response.

Thanks,
-Vineet.

Sunday, March 11, 2012

Cannot create diagram and not run jobs with my domain account logi

Hi!
I'm using SQL Server 2005 Dev. Ed. on a local machine. I'm logging in with
my domain account (HIK\Tommy) wich is a member of the Administrators group on
my computer and there is a corresponding Windows login account with sysadmin
permissions in SQL Server.
I can do most things with that account, BUT when I try to create a diagram
to a database. SQL does not like the owner of the database (my domain
account)
This is the error message that show up:
"Database diagram support objects cannot be installed because this database
does not have a valid owner. To continue, first use the Files page of the
Database Properties dialog box or ALTER AUTHORIZATION statement to set the
database owner to a valid login, then add the database diagram support
objects."
Again when I try to run a job that is owned by my domain account (HIK\Tommy)
Following message arise:
"The job failed. Unable to determine if the owner (HIK\Tommy) of job
MaintenancePlan2 has server access (reason: Could not obtain information
about Windows NT group/user 'HIK\Tommy', error code 0xea. [SQLSTATE 42000]
(Error 15404) The statement has been terminated. [SQLSTATE 01000] (Error
3621))."
I would be very grateful if you could come up with some suggestions.
Regards
TommyThis might be due to a mismatch between the 'dbo' user mapping and the
actual database owner. You can correct this with sp_changedbowner:
USE MyDatabase
EXEC sp_changedbowner 'HIK\Tommy'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Tommy" <Tommy@.discussions.microsoft.com> wrote in message
news:72BBE688-4C5D-4472-8404-513522E803A1@.microsoft.com...
> Hi!
> I'm using SQL Server 2005 Dev. Ed. on a local machine. I'm logging in with
> my domain account (HIK\Tommy) wich is a member of the Administrators group
> on
> my computer and there is a corresponding Windows login account with
> sysadmin
> permissions in SQL Server.
> I can do most things with that account, BUT when I try to create a diagram
> to a database. SQL does not like the owner of the database (my domain
> account)
> This is the error message that show up:
> "Database diagram support objects cannot be installed because this
> database
> does not have a valid owner. To continue, first use the Files page of the
> Database Properties dialog box or ALTER AUTHORIZATION statement to set the
> database owner to a valid login, then add the database diagram support
> objects."
> Again when I try to run a job that is owned by my domain account
> (HIK\Tommy)
> Following message arise:
> "The job failed. Unable to determine if the owner (HIK\Tommy) of job
> MaintenancePlan2 has server access (reason: Could not obtain information
> about Windows NT group/user 'HIK\Tommy', error code 0xea. [SQLSTATE 42000]
> (Error 15404) The statement has been terminated. [SQLSTATE 01000] (Error
> 3621))."
> I would be very grateful if you could come up with some suggestions.
> Regards
> Tommy|||Thanks for your suggestion but it does not work.
USE MyDatabase
EXEC sp_changedbowner 'HIK\Tommy'
doesn't change anything.
On the other hand it 's possible to change user to sa and everything works
OK, so it's my domain name that is the trouble. Have never had this problem i
SQL Server 2K.
/Tommy
"Dan Guzman" wrote:
> This might be due to a mismatch between the 'dbo' user mapping and the
> actual database owner. You can correct this with sp_changedbowner:
> USE MyDatabase
> EXEC sp_changedbowner 'HIK\Tommy'
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Tommy" <Tommy@.discussions.microsoft.com> wrote in message
> news:72BBE688-4C5D-4472-8404-513522E803A1@.microsoft.com...
> > Hi!
> > I'm using SQL Server 2005 Dev. Ed. on a local machine. I'm logging in with
> > my domain account (HIK\Tommy) wich is a member of the Administrators group
> > on
> > my computer and there is a corresponding Windows login account with
> > sysadmin
> > permissions in SQL Server.
> >
> > I can do most things with that account, BUT when I try to create a diagram
> > to a database. SQL does not like the owner of the database (my domain
> > account)
> >
> > This is the error message that show up:
> > "Database diagram support objects cannot be installed because this
> > database
> > does not have a valid owner. To continue, first use the Files page of the
> > Database Properties dialog box or ALTER AUTHORIZATION statement to set the
> > database owner to a valid login, then add the database diagram support
> > objects."
> >
> > Again when I try to run a job that is owned by my domain account
> > (HIK\Tommy)
> >
> > Following message arise:
> >
> > "The job failed. Unable to determine if the owner (HIK\Tommy) of job
> > MaintenancePlan2 has server access (reason: Could not obtain information
> > about Windows NT group/user 'HIK\Tommy', error code 0xea. [SQLSTATE 42000]
> > (Error 15404) The statement has been terminated. [SQLSTATE 01000] (Error
> > 3621))."
> >
> > I would be very grateful if you could come up with some suggestions.
> >
> > Regards
> > Tommy
>
>|||My apologies but I misread your post. I guess I should a finished my coffee
first :-)
For your first issue, the database needs to be in 90 compatibility mode in
order to create diagrams.
Regarding your second problem, run the SQL Server Configuration utility to
make sure the SQL Agent isn't running under the Network Service account.
Use a domain account.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Tommy" <Tommy@.discussions.microsoft.com> wrote in message
news:753C2D7A-C719-4B67-8CCD-0E3A03A9B8D5@.microsoft.com...
> Thanks for your suggestion but it does not work.
> USE MyDatabase
> EXEC sp_changedbowner 'HIK\Tommy'
> doesn't change anything.
> On the other hand it 's possible to change user to sa and everything works
> OK, so it's my domain name that is the trouble. Have never had this
> problem i
> SQL Server 2K.
> /Tommy
> "Dan Guzman" wrote:
>> This might be due to a mismatch between the 'dbo' user mapping and the
>> actual database owner. You can correct this with sp_changedbowner:
>> USE MyDatabase
>> EXEC sp_changedbowner 'HIK\Tommy'
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Tommy" <Tommy@.discussions.microsoft.com> wrote in message
>> news:72BBE688-4C5D-4472-8404-513522E803A1@.microsoft.com...
>> > Hi!
>> > I'm using SQL Server 2005 Dev. Ed. on a local machine. I'm logging in
>> > with
>> > my domain account (HIK\Tommy) wich is a member of the Administrators
>> > group
>> > on
>> > my computer and there is a corresponding Windows login account with
>> > sysadmin
>> > permissions in SQL Server.
>> >
>> > I can do most things with that account, BUT when I try to create a
>> > diagram
>> > to a database. SQL does not like the owner of the database (my domain
>> > account)
>> >
>> > This is the error message that show up:
>> > "Database diagram support objects cannot be installed because this
>> > database
>> > does not have a valid owner. To continue, first use the Files page of
>> > the
>> > Database Properties dialog box or ALTER AUTHORIZATION statement to set
>> > the
>> > database owner to a valid login, then add the database diagram support
>> > objects."
>> >
>> > Again when I try to run a job that is owned by my domain account
>> > (HIK\Tommy)
>> >
>> > Following message arise:
>> >
>> > "The job failed. Unable to determine if the owner (HIK\Tommy) of job
>> > MaintenancePlan2 has server access (reason: Could not obtain
>> > information
>> > about Windows NT group/user 'HIK\Tommy', error code 0xea. [SQLSTATE
>> > 42000]
>> > (Error 15404) The statement has been terminated. [SQLSTATE 01000]
>> > (Error
>> > 3621))."
>> >
>> > I would be very grateful if you could come up with some suggestions.
>> >
>> > Regards
>> > Tommy
>>|||Using a domain account for the Agent and SQL Server service solves the
problem with recognizeing job owner as my domain login (HIK\Tommy), but it
still don't like my domain login as database owner when trying to create a
diagram.
My administrator don't want me to use a domain account for services for
security reasons so, I'm going to use a workaround, e.g. use sa as owner
until this bug (?) is fixed.
Thank's anyway
Tommy
"Dan Guzman" wrote:
> My apologies but I misread your post. I guess I should a finished my coffee
> first :-)
> For your first issue, the database needs to be in 90 compatibility mode in
> order to create diagrams.
> Regarding your second problem, run the SQL Server Configuration utility to
> make sure the SQL Agent isn't running under the Network Service account.
> Use a domain account.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Tommy" <Tommy@.discussions.microsoft.com> wrote in message
> news:753C2D7A-C719-4B67-8CCD-0E3A03A9B8D5@.microsoft.com...
> > Thanks for your suggestion but it does not work.
> >
> > USE MyDatabase
> > EXEC sp_changedbowner 'HIK\Tommy'
> >
> > doesn't change anything.
> >
> > On the other hand it 's possible to change user to sa and everything works
> > OK, so it's my domain name that is the trouble. Have never had this
> > problem i
> > SQL Server 2K.
> >
> > /Tommy
> >
> > "Dan Guzman" wrote:
> >
> >> This might be due to a mismatch between the 'dbo' user mapping and the
> >> actual database owner. You can correct this with sp_changedbowner:
> >>
> >> USE MyDatabase
> >> EXEC sp_changedbowner 'HIK\Tommy'
> >>
> >> --
> >> Hope this helps.
> >>
> >> Dan Guzman
> >> SQL Server MVP
> >>
> >> "Tommy" <Tommy@.discussions.microsoft.com> wrote in message
> >> news:72BBE688-4C5D-4472-8404-513522E803A1@.microsoft.com...
> >> > Hi!
> >> > I'm using SQL Server 2005 Dev. Ed. on a local machine. I'm logging in
> >> > with
> >> > my domain account (HIK\Tommy) wich is a member of the Administrators
> >> > group
> >> > on
> >> > my computer and there is a corresponding Windows login account with
> >> > sysadmin
> >> > permissions in SQL Server.
> >> >
> >> > I can do most things with that account, BUT when I try to create a
> >> > diagram
> >> > to a database. SQL does not like the owner of the database (my domain
> >> > account)
> >> >
> >> > This is the error message that show up:
> >> > "Database diagram support objects cannot be installed because this
> >> > database
> >> > does not have a valid owner. To continue, first use the Files page of
> >> > the
> >> > Database Properties dialog box or ALTER AUTHORIZATION statement to set
> >> > the
> >> > database owner to a valid login, then add the database diagram support
> >> > objects."
> >> >
> >> > Again when I try to run a job that is owned by my domain account
> >> > (HIK\Tommy)
> >> >
> >> > Following message arise:
> >> >
> >> > "The job failed. Unable to determine if the owner (HIK\Tommy) of job
> >> > MaintenancePlan2 has server access (reason: Could not obtain
> >> > information
> >> > about Windows NT group/user 'HIK\Tommy', error code 0xea. [SQLSTATE
> >> > 42000]
> >> > (Error 15404) The statement has been terminated. [SQLSTATE 01000]
> >> > (Error
> >> > 3621))."
> >> >
> >> > I would be very grateful if you could come up with some suggestions.
> >> >
> >> > Regards
> >> > Tommy
> >>
> >>
> >>
>
>|||> My administrator don't want me to use a domain account for services for
> security reasons so, I'm going to use a workaround, e.g. use sa as owner
> until this bug (?) is fixed.
The Books Online (Setting up Windows Accounts) states that it is best is to
use minimally privileged accounts for services. If you don't want to use a
low privilege domain user, you can use a (minimally privileged) local
Windows user account. I don't think this a a bug, it's just that SQL 2005
is more secure out-of-the-box so additional configuration work is needed to
loosen up security according to your organization's security policies.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Tommy" <Tommy@.discussions.microsoft.com> wrote in message
news:ED165CD9-5A84-4D4F-AC22-BF57C87A1A16@.microsoft.com...
> Using a domain account for the Agent and SQL Server service solves the
> problem with recognizeing job owner as my domain login (HIK\Tommy), but it
> still don't like my domain login as database owner when trying to create a
> diagram.
> My administrator don't want me to use a domain account for services for
> security reasons so, I'm going to use a workaround, e.g. use sa as owner
> until this bug (?) is fixed.
> Thank's anyway
> Tommy
> "Dan Guzman" wrote:
>> My apologies but I misread your post. I guess I should a finished my
>> coffee
>> first :-)
>> For your first issue, the database needs to be in 90 compatibility mode
>> in
>> order to create diagrams.
>> Regarding your second problem, run the SQL Server Configuration utility
>> to
>> make sure the SQL Agent isn't running under the Network Service account.
>> Use a domain account.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Tommy" <Tommy@.discussions.microsoft.com> wrote in message
>> news:753C2D7A-C719-4B67-8CCD-0E3A03A9B8D5@.microsoft.com...
>> > Thanks for your suggestion but it does not work.
>> >
>> > USE MyDatabase
>> > EXEC sp_changedbowner 'HIK\Tommy'
>> >
>> > doesn't change anything.
>> >
>> > On the other hand it 's possible to change user to sa and everything
>> > works
>> > OK, so it's my domain name that is the trouble. Have never had this
>> > problem i
>> > SQL Server 2K.
>> >
>> > /Tommy
>> >
>> > "Dan Guzman" wrote:
>> >
>> >> This might be due to a mismatch between the 'dbo' user mapping and the
>> >> actual database owner. You can correct this with sp_changedbowner:
>> >>
>> >> USE MyDatabase
>> >> EXEC sp_changedbowner 'HIK\Tommy'
>> >>
>> >> --
>> >> Hope this helps.
>> >>
>> >> Dan Guzman
>> >> SQL Server MVP
>> >>
>> >> "Tommy" <Tommy@.discussions.microsoft.com> wrote in message
>> >> news:72BBE688-4C5D-4472-8404-513522E803A1@.microsoft.com...
>> >> > Hi!
>> >> > I'm using SQL Server 2005 Dev. Ed. on a local machine. I'm logging
>> >> > in
>> >> > with
>> >> > my domain account (HIK\Tommy) wich is a member of the Administrators
>> >> > group
>> >> > on
>> >> > my computer and there is a corresponding Windows login account with
>> >> > sysadmin
>> >> > permissions in SQL Server.
>> >> >
>> >> > I can do most things with that account, BUT when I try to create a
>> >> > diagram
>> >> > to a database. SQL does not like the owner of the database (my
>> >> > domain
>> >> > account)
>> >> >
>> >> > This is the error message that show up:
>> >> > "Database diagram support objects cannot be installed because this
>> >> > database
>> >> > does not have a valid owner. To continue, first use the Files page
>> >> > of
>> >> > the
>> >> > Database Properties dialog box or ALTER AUTHORIZATION statement to
>> >> > set
>> >> > the
>> >> > database owner to a valid login, then add the database diagram
>> >> > support
>> >> > objects."
>> >> >
>> >> > Again when I try to run a job that is owned by my domain account
>> >> > (HIK\Tommy)
>> >> >
>> >> > Following message arise:
>> >> >
>> >> > "The job failed. Unable to determine if the owner (HIK\Tommy) of
>> >> > job
>> >> > MaintenancePlan2 has server access (reason: Could not obtain
>> >> > information
>> >> > about Windows NT group/user 'HIK\Tommy', error code 0xea. [SQLSTATE
>> >> > 42000]
>> >> > (Error 15404) The statement has been terminated. [SQLSTATE 01000]
>> >> > (Error
>> >> > 3621))."
>> >> >
>> >> > I would be very grateful if you could come up with some suggestions.
>> >> >
>> >> > Regards
>> >> > Tommy
>> >>
>> >>
>> >>
>>

Cannot create an ODBC connection to SQl 2000.

Hi all,

I have SQL 2000 enterprise edition(no service pack) installed on a Windows Server 2003 machine. I can remote access into the server and run SQL but I cannot create an ODBC connection to this from my desktop. From some research it looks like installing service packs might correct this but here is the error:

--connection failed

--sqlstate '01000'

--sql server error 10061

--connection failed

--sqlstate 08001

--sql server error 17

--SQL server does not exist or access denied

Any help would be appreciated.

Verify whether the SQL Server is listening on a TCP port. If it's a default instance it is by default 1433, so you can use

netstat -an | findstr 1433

If not but the TCP protocol is turned on for the server (and set to port 1433) then upgrading to the latest service pack will most likely solve your problem.

|||

It'd better for you to upgrade SQL Server 2000 to latest service pack 4 from here:

http://support.microsoft.com/kb/290211#EOADAA

then make sure following things before you make connection:

1) SQL Service is running

2) If make remote connection, make sure named pipe or TCP was enabled and try Peter's suggestion if you want to connect through tcp.

HTH.

Thursday, March 8, 2012

Cannot create a file through a file share subscription

Hi
I am trying to create a file share subscription for a report. I have
specified a valid unc path for the file.
When the schedule is run ny SQL Agent, it returns the following error:
"Failure writing file Depth Distribution : The Report Server has encountered
a configuration error; more details in the log files"
When I look at the log file, there is no error indicated. It just says the
following:
w3wp!subscription!1ec4!05/04/2005-15:26:58:: Subscription Created for report
/TRACKERS Templates/Dist Tracker Template/Depth Distribution at
2005-05-04T15:26:58 by NSchneider
w3wp!library!1358!05/04/2005-15:26:59:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:26:59:: i INFO: Call to GetSystemPermissions
w3wp!library!1ec4!05/04/2005-15:27:02:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1ec4!05/04/2005-15:27:02:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:02:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:02:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:03:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:03:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:04:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:04:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:06:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:06:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:09:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:09:: i INFO: Call to GetSystemPermissions
w3wp!library!1ec4!05/04/2005-15:27:09:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1ec4!05/04/2005-15:27:09:: i INFO: Call to GetSystemPermissions
w3wp!library!1358!05/04/2005-15:27:10:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1358!05/04/2005-15:27:10:: i INFO: Call to GetSystemPermissions
w3wp!library!1ec4!05/04/2005-15:27:10:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1ec4!05/04/2005-15:27:10:: i INFO: Call to GetSystemPermissions
w3wp!library!1ec4!05/04/2005-15:27:11:: i INFO: Call to
GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
w3wp!library!1ec4!05/04/2005-15:27:11:: i INFO: Call to GetSystemPermissions
Does anyone know what is going on here?
Thanking you in advanceHi,
This could be a permission issue. Make sure the account executed the
subscription is in local user account and has access permission to the share
path.
Charles
"PORRASTAR" wrote:
> Hi
> I am trying to create a file share subscription for a report. I have
> specified a valid unc path for the file.
> When the schedule is run ny SQL Agent, it returns the following error:
> "Failure writing file Depth Distribution : The Report Server has encountered
> a configuration error; more details in the log files"
> When I look at the log file, there is no error indicated. It just says the
> following:
> w3wp!subscription!1ec4!05/04/2005-15:26:58:: Subscription Created for report
> /TRACKERS Templates/Dist Tracker Template/Depth Distribution at
> 2005-05-04T15:26:58 by NSchneider
> w3wp!library!1358!05/04/2005-15:26:59:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:26:59:: i INFO: Call to GetSystemPermissions
> w3wp!library!1ec4!05/04/2005-15:27:02:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1ec4!05/04/2005-15:27:02:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:02:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:02:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:03:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:03:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:04:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:04:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:05:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:06:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:06:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:09:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:09:: i INFO: Call to GetSystemPermissions
> w3wp!library!1ec4!05/04/2005-15:27:09:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1ec4!05/04/2005-15:27:09:: i INFO: Call to GetSystemPermissions
> w3wp!library!1358!05/04/2005-15:27:10:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1358!05/04/2005-15:27:10:: i INFO: Call to GetSystemPermissions
> w3wp!library!1ec4!05/04/2005-15:27:10:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1ec4!05/04/2005-15:27:10:: i INFO: Call to GetSystemPermissions
> w3wp!library!1ec4!05/04/2005-15:27:11:: i INFO: Call to
> GetPermissions:/TRACKERS Templates/Dist Tracker Template/Depth Distribution
> w3wp!library!1ec4!05/04/2005-15:27:11:: i INFO: Call to GetSystemPermissions
> Does anyone know what is going on here?
> Thanking you in advance
>

Cannot create a connection to the datasource 'DataSource1'

Hello, I Created a report with reportbuilder, after clicking on Run Report I got this message, Its very strange it seems that its trying to generate or create a datasource.

Para obtener más información acerca de este error, vaya al servidor de informes en el equipo del servidor local o habilite los errores remotos
-
No se puede crear una conexión al origen de datos 'dataSource1'.
-
Error al procesar el informe.

Hello,

This error means that the connection could not be established with the information provided in the data source element, named 'dataSource1', which is in the RDL that report builder creates.

There should be more information regarding why this error occurred in the log files. See the following link on how to locate the log files.

http://msdn2.microsoft.com/en-us/library/ms157403.aspx

Ian

Cannot create a connection to data source 'myservername'.

No matter how many times I redeploy my report and data sources from my
project to Report Manager, I keep getting this error when trying to run
the report from Reprt manager. It runs fine in VS 2005 though. I
don't know what else to do. I see no way to delete the report from
Report Manager in attempts to try to redeploy it from scratch either.
"An error has occurred during report processing.
Cannot create a connection to data source 'myservername'.
For more information about this error navigate to the report server on
the local server machine, or enable remote errors "In report manager on the datasource properties, credentials tab and set the
credentials to be used. Then when deploying do not overwirte the datasource
(this is the default behavior, to not overwrite the source).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"dba123" <d_schinkel@.hotmail.com> wrote in message
news:1141683199.061931.270510@.u72g2000cwu.googlegroups.com...
> No matter how many times I redeploy my report and data sources from my
> project to Report Manager, I keep getting this error when trying to run
> the report from Reprt manager. It runs fine in VS 2005 though. I
> don't know what else to do. I see no way to delete the report from
> Report Manager in attempts to try to redeploy it from scratch either.
>
> "An error has occurred during report processing.
> Cannot create a connection to data source 'myservername'.
> For more information about this error navigate to the report server on
> the local server machine, or enable remote errors "
>

Cannot create a connection to data source 'mydatasourcename'.

No matter how many times I redeploy my report and data sources from my project to Report Manager, I keep getting this error when trying to run the report from Reprt manager. It runs fine in VS 2005 though. I don't know what else to do. I see no way to delete the report from Report Manager in attempts to try to redeploy it from scratch either.

  • An error has occurred during report processing.
  • Cannot create a connection to data source 'myservername'.
  • For more information about this error navigate to the report server on the local server machine, or enable remote errors
  • Report manager has an icon in the toolbar to toggle between list view (default view) and detail view. In the detail view, you can select a report and delete it.

    One reason why the connection could fail is that you are using Windows Integrated Security, but Kerberos is not set up for delegation.

    -- Robert

    |||I'm having the same problem. But how do I fix it without deleting my reports?|||

    If your report server and the database used to get report data are not on the same machine,

    1. Enable Kerberos protocol so that credentials can be delegated to other computers without limit.

    2. If enabling Kerberos is not an option, consider using either stored credentials or a combination of Windows Authentication and database authentication. For example, you can use Windows Authentication to connect a client to a report server, and then configure the report to use database authentication to access an external data source. For this use a specific username and password in the credentials tab of data source designer. The report server will use the specific credential to access the database server.

    Another option is to locate the report data sources on the same computer that hosts the report server.

  • Cannot create a connection to data source 'mydatasourcename'.

    No matter how many times I redeploy my report and data sources from my project to Report Manager, I keep getting this error when trying to run the report from Reprt manager. It runs fine in VS 2005 though. I don't know what else to do. I see no way to delete the report from Report Manager in attempts to try to redeploy it from scratch either.

  • An error has occurred during report processing.
  • Cannot create a connection to data source 'myservername'.
  • For more information about this error navigate to the report server on the local server machine, or enable remote errors
  • Report manager has an icon in the toolbar to toggle between list view (default view) and detail view. In the detail view, you can select a report and delete it.

    One reason why the connection could fail is that you are using Windows Integrated Security, but Kerberos is not set up for delegation.

    -- Robert

    |||I'm having the same problem. But how do I fix it without deleting my reports?|||

    If your report server and the database used to get report data are not on the same machine,

    1. Enable Kerberos protocol so that credentials can be delegated to other computers without limit.

    2. If enabling Kerberos is not an option, consider using either stored credentials or a combination of Windows Authentication and database authentication. For example, you can use Windows Authentication to connect a client to a report server, and then configure the report to use database authentication to access an external data source. For this use a specific username and password in the credentials tab of data source designer. The report server will use the specific credential to access the database server.

    Another option is to locate the report data sources on the same computer that hosts the report server.

  • Cannot create a connection to data source 'dataSource1'.

    I successfully created the a Report model and deployed it to the server. When i run the a simple report on the SQL Server where reporting Services is installed it runs fine. When I run the report from anywhere else, I get the error below. I don't have a datasource called 'dataSource1'.

    *******************************************************************

    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    -
    Cannot create a connection to data source 'dataSource1'.
    -
    An error has occurred during report processing.

    *******************************************************************

    Thanks for any help!

    Most likely, you configured the data source credentials to use "Windows Integrated Security".

    If you turn on remote errors (see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230593&SiteID=1), you would actually see the inner exception message which is most likely about a failed logon.

    Windows Integrated Security only works if your domain has Kerberos-delegation enabled - otherwise you will need to store credentials on the report server (more details: http://msdn2.microsoft.com/en-us/library/ms160330(SQL.90).aspx)

    -- Robert

    |||

    This is what I did to solve the error (just kept Windows Integrated Security enabled):

    Changed the connection string.

    From: SQLNCLI.1;Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True
    To: Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True


    This solved the 'Cannot find dataSource1 datasource' error.

    |||

    My heart goes out to anyone that has to deal with this message: Cannot create a connection to data source 'dataSource1'. Hopefully, this will help fix your issue. My configuration consists of 2 servers, both Win2003, no domain, one has the production database, the other has all reporting services including the report builder. I would get the message when I hit the "Run Report" button in Report builder. The problem has to do with passing credentials from the server that launches report builder to the server that hosts the data. The datasource1 is an internal datasource so don't bother looking for it. If you look in the trace logs it's passing ANONYMOUS LOGON, which has no permissions. So, to fix first create a user with Admin privileges with the same credentials on both servers. In IIS of the Reports server, go to Directory Security, Edit, and Enable Anonymous Access, place your user in the username/password boxes. Do not check integrated Windows authentication. Go into your report manager to configure your data sources. I have 2, one for report builder and one for report execution, but doesn't matter because they are both the same. For the data source(s), enter your connection string like this: Data Source=DBSERVER;Initial Catalog=DB;Integrated Security=True
    Then click on Credentials stored securely in the report server, enter your user name and password of the same user as above. (I gave this user admin priviliges on both boxes, and added this user as a login to the SQL Server database for the database server.)
    Below the username/password there are two checkboxes: Check the "Use as Windows Credentials when Connecting to the Data source" and leave the "Impersonate" unchecked. Think of it this way, you're creating the same user all the way through, IIS uses it, then Reporting Services uses it, then your DB server uses it, and finally SQL Server (where data is stored) uses it. This way there are no credential storing/passing problems, good luck!! jwf

    |||...one more thing from above, when launching the Report builder, enter the same credentials as your special user that was created and be sure to check the "Remember Me" checkbox for good measure.

    Cannot create a connection to data source 'dataSource1'.

    I successfully created the a Report model and deployed it to the server. When i run the a simple report on the SQL Server where reporting Services is installed it runs fine. When I run the report from anywhere else, I get the error below. I don't have a datasource called 'dataSource1'.

    *******************************************************************

    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    -
    Cannot create a connection to data source 'dataSource1'.
    -
    An error has occurred during report processing.

    *******************************************************************

    Thanks for any help!

    Most likely, you configured the data source credentials to use "Windows Integrated Security".

    If you turn on remote errors (see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230593&SiteID=1), you would actually see the inner exception message which is most likely about a failed logon.

    Windows Integrated Security only works if your domain has Kerberos-delegation enabled - otherwise you will need to store credentials on the report server (more details: http://msdn2.microsoft.com/en-us/library/ms160330(SQL.90).aspx)

    -- Robert

    |||

    This is what I did to solve the error (just kept Windows Integrated Security enabled):

    Changed the connection string.

    From: SQLNCLI.1;Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True
    To: Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True


    This solved the 'Cannot find dataSource1 datasource' error.

    |||

    My heart goes out to anyone that has to deal with this message: Cannot create a connection to data source 'dataSource1'. Hopefully, this will help fix your issue. My configuration consists of 2 servers, both Win2003, no domain, one has the production database, the other has all reporting services including the report builder. I would get the message when I hit the "Run Report" button in Report builder. The problem has to do with passing credentials from the server that launches report builder to the server that hosts the data. The datasource1 is an internal datasource so don't bother looking for it. If you look in the trace logs it's passing ANONYMOUS LOGON, which has no permissions. So, to fix first create a user with Admin privileges with the same credentials on both servers. In IIS of the Reports server, go to Directory Security, Edit, and Enable Anonymous Access, place your user in the username/password boxes. Do not check integrated Windows authentication. Go into your report manager to configure your data sources. I have 2, one for report builder and one for report execution, but doesn't matter because they are both the same. For the data source(s), enter your connection string like this: Data Source=DBSERVER;Initial Catalog=DB;Integrated Security=True
    Then click on Credentials stored securely in the report server, enter your user name and password of the same user as above. (I gave this user admin priviliges on both boxes, and added this user as a login to the SQL Server database for the database server.)
    Below the username/password there are two checkboxes: Check the "Use as Windows Credentials when Connecting to the Data source" and leave the "Impersonate" unchecked. Think of it this way, you're creating the same user all the way through, IIS uses it, then Reporting Services uses it, then your DB server uses it, and finally SQL Server (where data is stored) uses it. This way there are no credential storing/passing problems, good luck!! jwf

    |||...one more thing from above, when launching the Report builder, enter the same credentials as your special user that was created and be sure to check the "Remember Me" checkbox for good measure.

    Cannot create a connection to data source ''dataSource1''.

    I successfully created the a Report model and deployed it to the server. When i run the a simple report on the SQL Server where reporting Services is installed it runs fine. When I run the report from anywhere else, I get the error below. I don't have a datasource called 'dataSource1'.

    *******************************************************************

    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    -
    Cannot create a connection to data source 'dataSource1'.
    -
    An error has occurred during report processing.

    *******************************************************************

    Thanks for any help!

    Most likely, you configured the data source credentials to use "Windows Integrated Security".

    If you turn on remote errors (see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230593&SiteID=1), you would actually see the inner exception message which is most likely about a failed logon.

    Windows Integrated Security only works if your domain has Kerberos-delegation enabled - otherwise you will need to store credentials on the report server (more details: http://msdn2.microsoft.com/en-us/library/ms160330(SQL.90).aspx)

    -- Robert

    |||

    This is what I did to solve the error (just kept Windows Integrated Security enabled):

    Changed the connection string.

    From: SQLNCLI.1;Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True
    To: Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True


    This solved the 'Cannot find dataSource1 datasource' error.

    |||

    My heart goes out to anyone that has to deal with this message: Cannot create a connection to data source 'dataSource1'. Hopefully, this will help fix your issue. My configuration consists of 2 servers, both Win2003, no domain, one has the production database, the other has all reporting services including the report builder. I would get the message when I hit the "Run Report" button in Report builder. The problem has to do with passing credentials from the server that launches report builder to the server that hosts the data. The datasource1 is an internal datasource so don't bother looking for it. If you look in the trace logs it's passing ANONYMOUS LOGON, which has no permissions. So, to fix first create a user with Admin privileges with the same credentials on both servers. In IIS of the Reports server, go to Directory Security, Edit, and Enable Anonymous Access, place your user in the username/password boxes. Do not check integrated Windows authentication. Go into your report manager to configure your data sources. I have 2, one for report builder and one for report execution, but doesn't matter because they are both the same. For the data source(s), enter your connection string like this: Data Source=DBSERVER;Initial Catalog=DB;Integrated Security=True
    Then click on Credentials stored securely in the report server, enter your user name and password of the same user as above. (I gave this user admin priviliges on both boxes, and added this user as a login to the SQL Server database for the database server.)
    Below the username/password there are two checkboxes: Check the "Use as Windows Credentials when Connecting to the Data source" and leave the "Impersonate" unchecked. Think of it this way, you're creating the same user all the way through, IIS uses it, then Reporting Services uses it, then your DB server uses it, and finally SQL Server (where data is stored) uses it. This way there are no credential storing/passing problems, good luck!! jwf

    |||...one more thing from above, when launching the Report builder, enter the same credentials as your special user that was created and be sure to check the "Remember Me" checkbox for good measure.

    Cannot create a connection to data source ''dataSource1''.

    I successfully created the a Report model and deployed it to the server. When i run the a simple report on the SQL Server where reporting Services is installed it runs fine. When I run the report from anywhere else, I get the error below. I don't have a datasource called 'dataSource1'.

    *******************************************************************

    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    -
    Cannot create a connection to data source 'dataSource1'.
    -
    An error has occurred during report processing.

    *******************************************************************

    Thanks for any help!

    Most likely, you configured the data source credentials to use "Windows Integrated Security".

    If you turn on remote errors (see: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230593&SiteID=1), you would actually see the inner exception message which is most likely about a failed logon.

    Windows Integrated Security only works if your domain has Kerberos-delegation enabled - otherwise you will need to store credentials on the report server (more details: http://msdn2.microsoft.com/en-us/library/ms160330(SQL.90).aspx)

    -- Robert

    |||

    This is what I did to solve the error (just kept Windows Integrated Security enabled):

    Changed the connection string.

    From: SQLNCLI.1;Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True
    To: Data Source=SERVER;Initial Catalog=DATABASE;Integrated Security=True


    This solved the 'Cannot find dataSource1 datasource' error.

    |||

    My heart goes out to anyone that has to deal with this message: Cannot create a connection to data source 'dataSource1'. Hopefully, this will help fix your issue. My configuration consists of 2 servers, both Win2003, no domain, one has the production database, the other has all reporting services including the report builder. I would get the message when I hit the "Run Report" button in Report builder. The problem has to do with passing credentials from the server that launches report builder to the server that hosts the data. The datasource1 is an internal datasource so don't bother looking for it. If you look in the trace logs it's passing ANONYMOUS LOGON, which has no permissions. So, to fix first create a user with Admin privileges with the same credentials on both servers. In IIS of the Reports server, go to Directory Security, Edit, and Enable Anonymous Access, place your user in the username/password boxes. Do not check integrated Windows authentication. Go into your report manager to configure your data sources. I have 2, one for report builder and one for report execution, but doesn't matter because they are both the same. For the data source(s), enter your connection string like this: Data Source=DBSERVER;Initial Catalog=DB;Integrated Security=True
    Then click on Credentials stored securely in the report server, enter your user name and password of the same user as above. (I gave this user admin priviliges on both boxes, and added this user as a login to the SQL Server database for the database server.)
    Below the username/password there are two checkboxes: Check the "Use as Windows Credentials when Connecting to the Data source" and leave the "Impersonate" unchecked. Think of it this way, you're creating the same user all the way through, IIS uses it, then Reporting Services uses it, then your DB server uses it, and finally SQL Server (where data is stored) uses it. This way there are no credential storing/passing problems, good luck!! jwf

    |||...one more thing from above, when launching the Report builder, enter the same credentials as your special user that was created and be sure to check the "Remember Me" checkbox for good measure.

    Cannot create a connection to data source

    When I log onto my test report services 2005 I can run this report fine after deploying it using IE on the reportserver. However when I go back to my own PC, I get this error when trying to access the report from my PC browser:

  • An error has occurred during report processing.
  • Cannot create a connection to data source 'MBNATEST'.
  • For more information about this error navigate to the report server on the local server machine, or enable remote errorsnevermind, figured it out myself:

    In Report Manager

    1) Click on Properties
    2) Click on Data Sources
    3) Make your Data Source Shared

  • Cannot create a connection to data source

    Windows 2003 Enterprise SP1, Sql Server 2005 June CTP.
    I created a report on data from another server. I can run the report just
    fine on the server with Reporting Services.
    When I try to run the report from my computer I get the cannot create
    connection error. I have full rights to the server and sa privilages to SQL
    Server on the RS server and the remote server on which the data is located.
    I have checked with the Network administrator and kerberos is enabled.
    I really need to get this working and prove to management that RS will do
    all we need in the way of a reporting tool.
    Your help will be apprecited.
    RoyWith the June CTP comes the Surface Area Configuration tool. Launch the
    tool and makes sure that remote connections are enabled for your SQL
    Server. By default, SQL is much tighter on security and remote connections
    are off after initial install.
    --
    | Thread-Topic: Cannot create a connection to data source
    | thread-index: AcWsvM7xh3SUrYS9QcCFLHwzj12wwg==| X-WBNR-Posting-Host: 65.118.63.88
    | From: =?Utf-8?B?Um95?= <Roy@.discussions.microsoft.com>
    | Subject: Cannot create a connection to data source
    | Date: Mon, 29 Aug 2005 10:12:17 -0700
    | Lines: 12
    | Message-ID: <EB5CC7FC-F898-48AC-A8CD-E9B6668EF797@.microsoft.com>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.sqlserver.reportingsvcs
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:51349
    | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
    |
    | Windows 2003 Enterprise SP1, Sql Server 2005 June CTP.
    | I created a report on data from another server. I can run the report just
    | fine on the server with Reporting Services.
    | When I try to run the report from my computer I get the cannot create
    | connection error. I have full rights to the server and sa privilages to
    SQL
    | Server on the RS server and the remote server on which the data is
    located.
    | I have checked with the Network administrator and kerberos is enabled.
    | I really need to get this working and prove to management that RS will do
    | all we need in the way of a reporting tool.
    | Your help will be apprecited.
    | Roy
    |
    ||||Brad,
    I did set the server to allow remote connections.
    Roy
    ""Brad Syputa - MS"" wrote:
    > With the June CTP comes the Surface Area Configuration tool. Launch the
    > tool and makes sure that remote connections are enabled for your SQL
    > Server. By default, SQL is much tighter on security and remote connections
    > are off after initial install.
    > --
    > | Thread-Topic: Cannot create a connection to data source
    > | thread-index: AcWsvM7xh3SUrYS9QcCFLHwzj12wwg==> | X-WBNR-Posting-Host: 65.118.63.88
    > | From: =?Utf-8?B?Um95?= <Roy@.discussions.microsoft.com>
    > | Subject: Cannot create a connection to data source
    > | Date: Mon, 29 Aug 2005 10:12:17 -0700
    > | Lines: 12
    > | Message-ID: <EB5CC7FC-F898-48AC-A8CD-E9B6668EF797@.microsoft.com>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.sqlserver.reportingsvcs
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:51349
    > | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
    > |
    > | Windows 2003 Enterprise SP1, Sql Server 2005 June CTP.
    > | I created a report on data from another server. I can run the report just
    > | fine on the server with Reporting Services.
    > | When I try to run the report from my computer I get the cannot create
    > | connection error. I have full rights to the server and sa privilages to
    > SQL
    > | Server on the RS server and the remote server on which the data is
    > located.
    > | I have checked with the Network administrator and kerberos is enabled.
    > | I really need to get this working and prove to management that RS will do
    > | all we need in the way of a reporting tool.
    > | Your help will be apprecited.
    > | Roy
    > |
    > |
    >

    Wednesday, March 7, 2012

    Cannot Convet Sql image to Byte[]

    I have followed many examples found on this site, but still get an invalid cast execption when I attempt to run code below. the exception is thrown when I try to convert the sql image to a byte[] in the download section of the code.


    //
    // sqlUploadImage
    //
    this.sqlUploadImage.CommandText = "INSERT INTO Image_Table (Description, Type, Lenth, DocName) VALUES (@.Description," +
    " @.Type, @.Length, @.DocName)";
    this.sqlUploadImage.Connection = this.sqlConnection2;
    this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Description", System.Data.SqlDbType.VarChar, 50, "Description"));
    this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Type", System.Data.SqlDbType.VarChar, 50, "Type"));
    this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Length", System.Data.SqlDbType.Int, 4, "Lenth"));
    this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.DocName", System.Data.SqlDbType.VarChar, 50, "DocName"));
    this.sqlUploadImage.Parameters.Add(new System.Data.SqlClient.SqlParameter("@.Image", System.Data.SqlDbType.Image, 16, "ImgField"));
    this.Button2.Click += new System.EventHandler(this.Button2_Click);
    //
    // sqlDownLoadImage
    //
    this.sqlDownLoadImage.CommandText = "SELECT Image_Table.* FROM Image_Table";
    this.sqlDownLoadImage.Connection = this.sqlConnection2;

    //upload file
    private void Button1_Click(object sender, System.EventArgs e)
    {
    //Get the filename of the pdf file to be uploaded.
    string strFilename = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") +1);

    //Get the file type
    string strFileType = File1.PostedFile.ContentType;

    //Get the file size
    int intImageSize = File1.PostedFile.ContentLength;

    // Reads the Image
    Stream ImageStream = File1.PostedFile.InputStream;

    byte[] ImageContent = new byte[intImageSize + 1];
    int intStatus = 0;
    intStatus = ImageStream.Read(ImageContent, 0, intImageSize);

    //Response.Write(strFilename.ToString());
    //Response.Write("<br>Image Type: " + strFileType.ToString());
    //Response.Write("<br>Image Size: "+intImageSize.ToString());

    this.sqlUploadImage.Parameters["@.Description"].Value = strFilename;
    this.sqlUploadImage.Parameters["@.Type"].Value = strFileType;
    this.sqlUploadImage.Parameters["@.Length"].Value = intImageSize;
    this.sqlUploadImage.Parameters["@.DocName"].Value = "TestPDF";
    this.sqlUploadImage.Parameters["@.Image"].Value = ImageContent;

    try
    {
    this.sqlConnection2.Open();
    this.sqlUploadImage.ExecuteNonQuery();

    this.Label2.Text = "File Uploaded Successfully";
    this.Button2.Visible = true;
    }
    catch(SqlException ex)
    {
    Response.Write(ex.ToString());
    }
    finally
    {
    this.sqlConnection2.Close();
    }
    }

    //download file
    private void Button2_Click(object sender, System.EventArgs e)
    {
    try
    {
    this.sqlConnection2.Open();
    SqlDataReader r = this.sqlDownLoadImage.ExecuteReader(CommandBehavior.CloseConnection);

    if(r.Read())
    {

    Response.ContentType = r["Type"].ToString();
    byte[] image = (byte[])r["ImgField"];
    Response.BinaryWrite(image);
    }
    }
    catch(SqlException ex)
    {
    Response.Write(ex.ToString());
    }
    finally
    {
    this.sqlConnection2.Close();
    }
    }

    I am somewhat confused because the INSERT statement for your upload process only contains 4 parameters (even though 5 parameters are specified). So my guess is that the image is not gettng into the database (and is therefore NULL), and that is why you are getting the exception on the download portion?

    Terri|||Thanks for the reply, but there are 5 parameters.

    I have double check the database and all information is there for the upload and all information is valid.

    The problem is on the download.

    byte[] image = (byte[])r["ImgField"];

    throughs an invalid cast.... I have found many articles using this exact cast.|||HOly cow, I see it now.

    only 4 parameters.

    let me see if i change itl|||ok fixed my insert string.

    Now I have verifity there is nothing being uploaded to hte ImgField... it is DBNULL.|||Why are you adding 1 to the image file size when dimensioning the byte array? I thought the size of the byte array should match the file size?


    byte[] ImageContent = new byte[intImageSize];

    Terri|||Yes, fixed that also.

    Ok it uploads now.

    BUT, when I download I get just the binary information to output. And it doesn't output on in the browser but in a new webform.

    any ideas?

    Updated code here


    //
    // sqlConnection2
    //
    this.sqlConnection2.ConnectionString = ((string)(configurationAppSettings.GetValue("sqlConnection2.ConnectionString", typeof(string))));
    //
    // sqlDownLoadImage
    //
    this.sqlDownLoadImage.CommandText = "SELECT Image_Table.* FROM Image_Table";
    this.sqlDownLoadImage.Connection = this.sqlConnection2;
    //
    // sqlCommand1
    //
    this.sqlCommand1.CommandText = "SELECT ImgField, Type FROM Image_Table WHERE (ImageID = 1)";
    this.sqlCommand1.Connection = this.sqlConnection2;
    this.Load += new System.EventHandler(this.Page_Load);

    }
    #endregion

    //upload file
    private void Button1_Click(object sender, System.EventArgs e)
    {
    //Get the filename of the pdf file to be uploaded.
    string strFilename = File1.PostedFile.FileName.Substring(File1.PostedFile.FileName.LastIndexOf("\\") +1);

    //Get the file type
    string strFileType = File1.PostedFile.ContentType;

    //Get the file size
    int intImageSize = File1.PostedFile.ContentLength;

    //Reads teh image
    Stream imgStream = File1.PostedFile.InputStream;

    byte[] ImageContent = new byte[intImageSize];
    int intStatus = imgStream.Read(ImageContent, 0, intImageSize);

    //Response.Write(strFilename.ToString());
    //Response.Write("<br>Image Type: " + strFileType.ToString());
    //Response.Write("<br>Image Size: "+intImageSize.ToString());

    SqlCommand sqlUpload = new SqlCommand("INSERT INTO Image_Table(Description, ImgField, Type, Lenth, DocName)" +
    "VALUES (@.Description, @.Image, @.Type, @.Length, @.DocName)", this.sqlConnection2);

    SqlParameter param0 = new SqlParameter("@.Description", SqlDbType.VarChar, 50);
    param0.Value = strFilename;
    sqlUpload.Parameters.Add( param0 );

    SqlParameter param1 = new SqlParameter("@.Image", SqlDbType.Image);
    param1.Value = ImageContent;
    sqlUpload.Parameters.Add( param1 );

    SqlParameter param2 = new SqlParameter("@.Type", SqlDbType.VarChar, 50);
    param2.Value = strFileType;
    sqlUpload.Parameters.Add( param2 );

    SqlParameter param3 = new SqlParameter("@.Length", SqlDbType.Int);
    param3.Value = intImageSize;
    sqlUpload.Parameters.Add( param3 );

    SqlParameter param4 = new SqlParameter("@.DocName", SqlDbType.VarChar, 50);
    param4.Value = "Test PDF";
    sqlUpload.Parameters.Add( param4 );

    try
    {
    this.sqlConnection2.Open();
    sqlUpload.ExecuteNonQuery();

    this.Label2.Text = "File Uploaded Successfully";
    this.Button2.Visible = true;
    }
    catch(SqlException ex)
    {
    Response.Write(ex.ToString());
    }
    finally
    {
    this.sqlConnection2.Close();
    }
    }

    //download file
    private void Button2_Click(object sender, System.EventArgs e)
    {
    try
    {
    this.sqlConnection2.Open();
    SqlDataReader r = this.sqlDownLoadImage.ExecuteReader(CommandBehavior.CloseConnection);

    if(r.Read())
    {
    Response.ContentType = r["Type"].ToString();
    Response.BinaryWrite((byte[])r["ImgField"]);
    Response.
    }
    }
    catch(SqlException ex)
    {
    Response.Write(ex.ToString());
    }
    finally
    {
    this.sqlConnection2.Close();
    }
    }

    |||Ok, if I am working with photos, jpeg, gif etc.. the above code works great. But I need to store and view pdf files and this code is not working for that type of application/pdf

    please any ideas?|||I believe you need to use the Response object's AddHeader method in order to get that to work for you. I don't have any direct experience with that, but this post might help:view post 463798

    Terri|||Thanks,

    I am getting the same results it won't open in a broswer window when I use inline. I would like this to happen, but does this mean i must save the file first to a spot before I can view it.

    If that is true, will it be easier for me to just store the pdf's in a file structure on teh server and have teh database store a path to it?

    Thanks|||I am having a similar problem

    i am trying to use the example at:
    http://aspalliance.com/articleViewer.aspx?aId=140

    got the upload working

    the download is another story though.
    when i use the following code i get a conversion issue

    Response.BinaryWrite(myDataReader.Item("PersonImage"))

    it says that with option strict on, i can not make an implicit conversion from system.object to a 1-dimensional array of Byte.

    this is driving me crazy and all the above is way beyond me - as a beginner in this arena|||Instead of this:


    Response.BinaryWrite(myDataReader.Item("PersonImage"))

    try this:

    Response.BinaryWrite(CType(myDataReader.Item("PersonImage"), Byte()))

    That should explicitly do the conversion to a byte array.

    Terri|||

    Terri is a Stud!!!!!!!

    That worked FOR ME

    Cannot connect with ODBC using TCP/IP?

    Win 2003 Small business server with IIS being used as a web server.
    Our client app can log in and run queries, but our web app when trying to log in gets the message,
    'SQL server does not exsist or access denied'
    The system DSN's are both sql drivers and the configuration is name pipes. Our recomended specs use TCP/IP, but when I try to change it, it craps out on me. He's opened up his firewall completely to this new box and his old box, a Win2k machine can connect using TCP/IP. This machine is in a work group.
    Any suggestions on what it might be? :confused:instead of dsn, try dsn-less:
    http://www.connectionstrings.com/

    Tuesday, February 14, 2012

    Cannot connect to MSDE on SBS 2003

    My client has installed e scanner program wich is suposed til run on a MSDE
    database. The program has to run on a reasently installed SBS 2003 server.
    The server is installed with only standard features, the isa server is not
    installed. Clients are running in a standard 2003 domain.
    The program is working fine on the server but clients cannot connect. I test
    from Excel to make the test as basic as possible. The primary client is a
    terminal server 2000 but trying from XP machines do not make any difference.
    I get the following error fra Excel:
    Connection failed:
    SQLState: '01000'
    SQL Server Error: 2
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()).
    Connection failed:
    SQLState: '08001'
    SQL Server Error: 17
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL server does not exist or
    acces is denied.
    To your infomation, the msde is the latest build and updates. The MDAC is
    updatet on the terminalserver.
    I suspect the SBS 2003 has shut down something somewhere but I have no clue
    where to look. I am a total norvice in SQL.
    I have checked the port 1433 an it is not "LISTENING" (nor 1434 if thats the
    port) Shall it be Listening and if so, how do I get it to listen?
    Michael,
    I had this exact problem on one of my SBS 2003 machines running MSDE.
    Often 3rd party backup software like Veritas Backup Exec, attaches to
    SQL/MSDE and modifies settings. Sometimes all communication protocols
    are disabled.
    To fix this, on the server run 'svrnetcn' and make sure that at least
    one protocol is enabled. As you checked port 1433 I assume you want to
    use TCP/IP, so ensure that at least TCP is in the 'Enabled Protocols'
    section.
    You also need to confirm that SQL is configured to communicate via this
    protocol on the client machines. To do this, run 'cliconfg' on the
    client machines. You will see a similar configuration tool to the
    server. Make sure the 'Enabled Protocols' match the server, ie
    confirm/add TCP.
    Good luck, Al.
    *** Sent via Developersdex http://www.codecomments.com ***

    Cannot connect to MSDE on SBS 2003

    My client has installed e scanner program wich is suposed til run on a MSDE
    database. The program has to run on a reasently installed SBS 2003 server.
    The server is installed with only standard features, the ISA server is not
    installed. Clients are running in a standard 2003 domain.
    The program is working fine on the server but clients cannot connect. I test
    from Excel to make the test as basic as possible. The primary client is a
    terminal server 2000 but trying from XP machines do not make any difference.
    I get the following error fra Excel:
    Connection failed:
    SQLState: '01000'
    SQL Server Error: 2
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Con
    nect()).
    Connection failed:
    SQLState: '08001'
    SQL Server Error: 17
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL server does not
    exist or
    acces is denied.
    To your infomation, the msde is the latest build and updates. The MDAC is
    updatet on the terminalserver.
    I suspect the SBS 2003 has shut down something somewhere but I have no clue
    where to look. I am a total norvice in SQL.
    I have checked the port 1433 an it is not "LISTENING" (nor 1434 if thats the
    port) Shall it be Listening and if so, how do I get it to listen?Michael,
    I had this exact problem on one of my SBS 2003 machines running MSDE.
    Often 3rd party backup software like Veritas Backup Exec, attaches to
    SQL/MSDE and modifies settings. Sometimes all communication protocols
    are disabled.
    To fix this, on the server run 'svrnetcn' and make sure that at least
    one protocol is enabled. As you checked port 1433 I assume you want to
    use TCP/IP, so ensure that at least TCP is in the 'Enabled Protocols'
    section.
    You also need to confirm that SQL is configured to communicate via this
    protocol on the client machines. To do this, run 'cliconfg' on the
    client machines. You will see a similar configuration tool to the
    server. Make sure the 'Enabled Protocols' match the server, ie
    confirm/add TCP.
    Good luck, Al.
    *** Sent via Developersdex http://www.codecomments.com ***