Showing posts with label isnt. Show all posts
Showing posts with label isnt. Show all posts

Saturday, February 25, 2012

Deployed Application isn't connecting to SQL Server

When deploying my application that uses sql server it doesn't connect to the server.

I checked the connection string & it's ok the server instance is the same.

The computer name isn't the same & i use the .\SQLExpress as the data source.

I get an error saying 'sqlserver does not allow remote connections error 26 locating server / instance specified'.

Since computer name is changed, can you try to recreate the data source again? When creating a datasource, you can verify that if the datasource is ok to connect to the server.|||Another thing to look at is that if computer name is changed, the servername might not be valid. Can you run select @.@.servername to verify?|||

This link can help you.

http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

|||

The connection string from the dataset that visual studio generated was wrong

it needed to be .\SQLExpress thanks to all for the help

Sunday, February 19, 2012

Deploy fails telling me the user don''t have permissions, but the user listed isn''t me!

I'm trying to deploy a project that I deployed yesterday just fine, but today I get the following error:

Deploy started: Project: Point Reports, Configuration: Debug

Deploying to http://reporting.companyname.com/reportserver

Deploying data source '/Data Sources/Srv24.FieldResponse2_1'.

The permissions granted to user 'DOMAIN\harley.p.bartman' are insufficient for performing this operation.

Deploy complete -- 1 errors, 0 warnings

This seems like a basic permission issue, except I'm not logged in as the user listed! I've never logged into my computer as the user. I did log in to the reporting services website yesterday as that user, but since have rebooted my machine and logged into bothe my computer and the reporting services website as me. Yesterday this report deployed fine. Today, this error message. I've even tried creating a new project and just creating a simple datasource and deploying just that, but still this message! Where is Visual Studio storing and reusing this user name during my deploy process?

It seems to me that it is storing those credentials in your datasource for the report.

Open your datasource for your report and check the credentials tab. Is "use a specific username and password" checked? If so, you might want to change that.

|||Everything is set to Windows Credentials (Integrated Security) on the datasource. At this point I can create a new project from scratch and when I try to deploy is still tries to do so under this other user's name. Obviously his name must be cached somewhere but I can't find how to clear it or to get Visual Studio to recognize that I'm me! I've tried clearing all my IE cache, but no luck.

|||

I've seen something like this in another thread, but I can't seem to dig it up. I think it has something to do with credentials in IIS.

Right click report server and reports in IIS and click properties. On the directory security tab, click edit under anonymous access. What is checked on this screen?

|||

Enable anonymous access is NOT checked. The only checked box in the Authentication Methods window is "Integrated Windows authentication". True for both Reports and ReportServer websites.

Deploy Excel file that already exists on server - file isn't replaced

Dear all,

I am deploying programatically an Excel 2007 file to a SQL Server 2005 Reporting Server. The problem is that if a file with the same name already exists, that file isn't replaced. I would like the opposite to happen. I'm using the following code:

--Executable

set svr=http://w3sdwsqld1/reportserver
set src_fld="\\w3sdwsqld1\\deploy\\SAD\\ECRANS\\UPDATES_20061127_190000\\Ecrans\\AM\\Associados\\"
set dest_fld="Associados"
set script="\\w3sdwsqld1\\deploy\\SAD\ECRANS\\UPDATES_20061127_190000\\Ecrans\\AM\\Associados\\PublishReports.rss"
REM Sample: deploy.bat http://w3sdwsqld1/reportserver "\\w3sdwsqld1\\deploy\\SAD\\ECRANS\\UPDATES_20061127_190000\\Ecrans\\AM\\Associados\\" "Associados" "\\w3sdwsqld1\\deploy\\SAD\ECRANS\\UPDATES_20061127_190000\\Ecrans\\AM\\Associados\\PublishReports.rss"
for /R %src_fld% %%f in (*.xlsx) do rs -i %script% -s %svr% -v ParentFolder=%dest_fld% -v reportP="%%~nf" -v path=%src_fld%
PAUSE

--rss Code


'
' Script Variables
'
' Variables that are passed on the command line with the -v switch:
'
' (a) parentFolder - corresponds to the folder that the script creates and uses
' to contain your published reports

' (b) reportP - corresponds to the report to publish


Dim ROOT As String = "/SAD/Ecrans/Ecrans/AM"

Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentPath As String = ROOT + "/"+ parentFolder
Dim filePath As String = path
Dim report As String = reportP


Public Sub Main()

rs.Credentials = System.Net.CredentialCache.DefaultCredentials

'Create the parent folder
Try
rs.CreateFolder(parentFolder, ROOT,Nothing)
Console.WriteLine("Parent folder {0} created successfully", parentFolder)
Catch e As Exception

Console.WriteLine(e.Message)

End Try

'Create shared data source
'CreateSampleDataSource("Solucao_Integrada", "OLEDB-MD", "Data Source=dwareas1;Initial Catalog=SAD_Solucao_Integrada")

'Publish the sample reports
PublishReport(report)


End Sub

Public Sub CreateSampleDataSource(name As String, extension As String, connectionString As String)
'Define the data source definition.
Dim definition As New DataSourceDefinition()
definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
definition.ConnectString = connectionString
definition.Enabled = True
definition.EnabledSpecified = True
definition.Extension = extension
definition.ImpersonateUser = False
definition.ImpersonateUserSpecified = True
'Use the default prompt string.
definition.Prompt = Nothing
definition.WindowsCredentials = False

Try
rs.CreateDataSource(name, parentPath, False, definition, Nothing)
Console.WriteLine("Data source {0} created successfully", name)

Catch e As Exception
Console.WriteLine(e.Message)
End Try

End Sub

Public Sub PublishReport(ByVal reportName As String)
Try
Dim stream As FileStream = File.OpenRead(filePath + reportName + ".xlsx")
Console.WriteLine(reportName)

definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()

Catch e As IOException
Console.WriteLine(e.Message)
End Try

Try
rs.CreateResource(reportName + ".xlsx", parentPath, True, definition, "application/x-excel", Nothing)

Catch e As Exception
Console.WriteLine(e.Message)
Console.WriteLine("Failed to publish report")
End Try
End Sub
--

Any thoughts? Many thanks,

Pedro Martins

Portugal

Pedro,

Try

It looks like the paths may not be correct, use the "filePath" that you use to open the file in the below statement.

rs.CreateResource(reportName + ".xlsx", filePath, True, definition, "application/x-excel", Nothing)

I normally created my Rss script insert console write message to return values so that I can make sure I getting the corrent values.

Let me know if this helps.

Ham

|||

Ham,

The path is correct, if I deploy the file and there is no other file in the destination the file is uploaded successfully. However, If a file with the same name already exists, the new file doesn't replace the old one.

Pedro

|||

Pedro

Is the file you are trying to replace - "Open" by another application? You could use the System.IO to check on the status of this file before you try and replace.

Ham