Showing posts with label deployed. Show all posts
Showing posts with label deployed. Show all posts

Sunday, March 25, 2012

Accessing data connection works locally, but not when deployed

Hi all, I hope this is a simple issue that I'm overlooking something or have contradicting permissions set somewhere. I have a fairly basic site with a subfolder containing an aspx page. The user logs in to gain access to the subfolder. That part works fine.
On another page(also within a subfolder in the subfolder), they can post form data to a database (SQL Server 2000) which exists on a different server than my web server. This page opens fine, but when submitting the data (only one value to one field for my testing purposes), it bombs and returns the error "Login failed for user"...
In my connection string I've specified the username and password which I assigned to the db in Enterprise Manager (not sa, btw). I've also tried letting IIS control the UID/PW, and even specified no UID/PW in either the connection string or the db. Anonymous access enabled in IIS for this virtual directory also returns the error. (?)
I should mention that in Visual Studio, the connection string was automatically set to my local development machine's workstation ID. I removed that and have tried replacing it with the server name, blank, etc.(in notepad) - to no avail. dll's are in their proper places, etc. The only thing not working is the database connection.
Using: IIS v6, SQL Server 2000, and Visual Studio.NET 2003 (1.1 framework)
Anyway - any suggestions? There are so many places to enable/disable permissions, it's getting confusing. I hope it's something I'm overlooking and not a problem with our SQL installation...
Thanks!
--DonnieI'm no longer getting the error when I press Submit, although now I need to figure out why the data isn't writing to the table. I think the problem now is in my query parameters. Here's what I did:
Recreated the DB and tables; recreated the SqlConnection in Visual Studio.
In IIS, I set the permissions to anonymous access using the IUSR_(mySERVER) (where server=the name of my web server)
In Enterprise Manager, I made the aspuser account the dbo on the database.(yep, I know this is not the best way...)
In my ASP.NET pages, I am using forms authentication and denying access to anonymous users (does this contradict the IIS setting? Should anonymous access be unchecked in IIS?)
I'm aware there are more than likely some security issues with this setup and will be working through the various posts and links here to fix them. This is a great site and it looks like I have a lot to learn, and will hopefully learn a lot here!
--Donnie|||Can you post the connection string (xxxx out the user id and password) and the code that does the data access?
Thanks,
Tyler

Thursday, March 22, 2012

Accessing Custom Assemblies

We are building a report via Business Intelligent Studio. We have deployed the custom assembly dll to two folders:

1. Microsoft Sql Server\MMSQL.3\Reporting Services\Report Server\bin

2. Microsoft Visual Studio 8\Common\IDE\private assemblies.

This dll is an instance dll.

When we open the report properties/reference tab, we can find and link to the dll. Which one of the above locations is the correct one? (We have #2).

We created the class and instance entry.

Next, we added a textbox to the report layout. When we try to use the =Code keyword we get an unrecognized identifier error.

Can anyone shed any light on why this is happening. We've spent considerable time trying to find any info on this with no luck.

Any help is appreciated

Information about using custom assemblies with reports can be found here:

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

For me, to use the assembly in BIDS the path is \Visual Studio 8\Common7\IDE\PrivateAssemblies

Note "Common7" and no spaces in "PrivateAssemblies".

Tuesday, March 20, 2012

Accessing .Net 2.0 custom assembly in report to be deployed on SSRS 2000 SP2

Hi ,
I am using SQL reporting services 2000 + SP2. In one of my report I am
using custom .Net 1.1 assembly. I have given the reference for the
same in the report.
The report gets deployed without any issues.
Recently we had to upgrade this custom assembly to .Net 2.0. Now when
I try to deploy this report on SSRS 2000 it gives me error "Error
while loading code module:<my custom assembly complete name> " and
"Details: The format of the file <my custom assembly name>is invalid."
I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
If I try to give reference to this .Net 2.0 binary again in the report
through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
"<my custom assembly name> does not contain an assembly".
How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
report. I have to use SSRS2000 SP2 as we cannot remove the support of
SSRS2000 SP2 for our reports.
Custom assembly been used is using various .Net 2.0 provided classes
now so it has to be in .Net 2.0.
Can I somehow tell the ASP.Net webapplication through various config
file that while using my custom binary load it in .Net 2.0 Framework?
I tried giving binding redirect but it did not work in the
Reprotserver config file . how can i specify the .Net framework
version in those entries?
Everything works fine in SSRS 2005 as the reporting service is also
in .Net 2.0
Regards,
ManojHi, I have the same issue. Have you got it fixed? How?
Could someone from MSFT give us an answer?
Thanks,
Lianghong
"Manoj" wrote:
> Hi ,
> I am using SQL reporting services 2000 + SP2. In one of my report I am
> using custom .Net 1.1 assembly. I have given the reference for the
> same in the report.
> The report gets deployed without any issues.
> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
> I try to deploy this report on SSRS 2000 it gives me error "Error
> while loading code module:<my custom assembly complete name> " and
> "Details: The format of the file <my custom assembly name>is invalid."
> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
> If I try to give reference to this .Net 2.0 binary again in the report
> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
> "<my custom assembly name> does not contain an assembly".
> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
> report. I have to use SSRS2000 SP2 as we cannot remove the support of
> SSRS2000 SP2 for our reports.
> Custom assembly been used is using various .Net 2.0 provided classes
> now so it has to be in .Net 2.0.
> Can I somehow tell the ASP.Net webapplication through various config
> file that while using my custom binary load it in .Net 2.0 Framework?
> I tried giving binding redirect but it did not work in the
> Reprotserver config file . how can i specify the .Net framework
> version in those entries?
>
> Everything works fine in SSRS 2005 as the reporting service is also
> in .Net 2.0
> Regards,
> Manoj
>|||dotNet 2.0 uses a different framework - have you installed the dotnet 2.0
framework on your server?
"Lianghong" <Lianghong@.discussions.microsoft.com> wrote in message
news:7423185E-C8BA-4D1E-BB04-6BF78AD4DCAB@.microsoft.com...
> Hi, I have the same issue. Have you got it fixed? How?
> Could someone from MSFT give us an answer?
> Thanks,
> Lianghong
> "Manoj" wrote:
>> Hi ,
>> I am using SQL reporting services 2000 + SP2. In one of my report I am
>> using custom .Net 1.1 assembly. I have given the reference for the
>> same in the report.
>> The report gets deployed without any issues.
>> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
>> I try to deploy this report on SSRS 2000 it gives me error "Error
>> while loading code module:<my custom assembly complete name> " and
>> "Details: The format of the file <my custom assembly name>is invalid."
>> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
>> If I try to give reference to this .Net 2.0 binary again in the report
>> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
>> "<my custom assembly name> does not contain an assembly".
>> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
>> report. I have to use SSRS2000 SP2 as we cannot remove the support of
>> SSRS2000 SP2 for our reports.
>> Custom assembly been used is using various .Net 2.0 provided classes
>> now so it has to be in .Net 2.0.
>> Can I somehow tell the ASP.Net webapplication through various config
>> file that while using my custom binary load it in .Net 2.0 Framework?
>> I tried giving binding redirect but it did not work in the
>> Reprotserver config file . how can i specify the .Net framework
>> version in those entries?
>>
>> Everything works fine in SSRS 2005 as the reporting service is also
>> in .Net 2.0
>> Regards,
>> Manoj
>>|||Yes. The .Net framework 2.0 is installed on the server.
"Bob" wrote:
> dotNet 2.0 uses a different framework - have you installed the dotnet 2.0
> framework on your server?
> "Lianghong" <Lianghong@.discussions.microsoft.com> wrote in message
> news:7423185E-C8BA-4D1E-BB04-6BF78AD4DCAB@.microsoft.com...
> > Hi, I have the same issue. Have you got it fixed? How?
> > Could someone from MSFT give us an answer?
> >
> > Thanks,
> > Lianghong
> >
> > "Manoj" wrote:
> >
> >> Hi ,
> >>
> >> I am using SQL reporting services 2000 + SP2. In one of my report I am
> >> using custom .Net 1.1 assembly. I have given the reference for the
> >> same in the report.
> >>
> >> The report gets deployed without any issues.
> >>
> >> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
> >> I try to deploy this report on SSRS 2000 it gives me error "Error
> >> while loading code module:<my custom assembly complete name> " and
> >> "Details: The format of the file <my custom assembly name>is invalid."
> >>
> >> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
> >>
> >> If I try to give reference to this .Net 2.0 binary again in the report
> >> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
> >> "<my custom assembly name> does not contain an assembly".
> >>
> >> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
> >> report. I have to use SSRS2000 SP2 as we cannot remove the support of
> >> SSRS2000 SP2 for our reports.
> >>
> >> Custom assembly been used is using various .Net 2.0 provided classes
> >> now so it has to be in .Net 2.0.
> >> Can I somehow tell the ASP.Net webapplication through various config
> >> file that while using my custom binary load it in .Net 2.0 Framework?
> >> I tried giving binding redirect but it did not work in the
> >> Reprotserver config file . how can i specify the .Net framework
> >> version in those entries?
> >>
> >>
> >> Everything works fine in SSRS 2005 as the reporting service is also
> >> in .Net 2.0
> >>
> >> Regards,
> >> Manoj
> >>
> >>
>
>

Friday, February 24, 2012

Access protection on deployed SQL Server

How can we control the accesses to a SQL Server that has been deployed on customer site? Basically, we do not want user to log in the database server, even as sa, except through our application.

Any recommendation?

Thanks,

Xiaodoudou

Hi!

Actually you cannot protect the data files. So although you might restrict the user / administrators from logging on to the database you cannot prevent them deatching the database and attaching it to another instance, making it possible for them to read the content of the database. YOu would need additional file security and prevent the administrator and all other users from accessing the physical files.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

In your case, I assume you have no control over the customer site - if that's the case, then you cannot enforce access only through your application.

Thanks
Laurentiu

Thursday, February 9, 2012

Access denied on deployment

Just deployed my web app at an ISP. The very first time I hit my database, I get an exception

'SQL Server does not exist or access denied'

I'm trying to connect using an SQL account with user id and password (which work fine if I go in using SQL Query Analyser).

The connection string contains the initial catalog, user id and password.

Can anybody help please?

Thanks,
BernieI assume you checked the remote data source address too.

Did you try connecting to the remote database using the Server Explorer inside of VS.Net? If you can connect to it through there, then just drag a table from the remote data source onto some test page. Look in the VS.Net generated code in the code behind and find where it creates the connection. Copy and paste this connection string info to where you need it.|||Are you sure you're using the correct server in the connection string?

When I first started doing this, in SQL Client Network Utitlity, I gave my server an Alias - - locally, that's what I was using, and when I uploaded the pages to the server, I'd forget to change the alias, and of course, it wouldn't work, since the host has no idea what that alias is.|||Thanks for the replies guys. I did as McMurdoStation suggested.
I could 'see' the server database and all of its tables from the VS.Net SQL server , so proceeded to create an SQL Adaptor/SQL Connection datagrid etc... on a test page.

When it tried to connect, the login failed, so I assume this is the same problem.

The connection string looks like:-
value="initial catalog=ClubNoticeBoard; user id=ClubNoticeBoard;pwd=*****;packet size=4096"

The one in the test page I created looks like
this.sqlConnection1.ConnectionString = "workstation id=BERNIE;packet size=4096;user id=ClubNoticeBoard;data source=\"URL here\";persist security info=False;initial catalog=ClubNoticeBoard";

I've just read somewhere that the ASPNET account must have access, that sounds reasobale as I can access the database fine except through the aspx pages. How do I go about setting up an ASPNET account using the SQL Server Enterprise Manager.

Cheers,
Bernie|||under SQL Server explorer, expand on the name of your database, right click on 'Users' and click on 'Add New Database user'. then add ASPNET user.

HTH.|||Ok, bearing in mind that this is a shared server at an ISP, when i did what you suggested, I get the New User box up requesting a Login name and User name. The Login name is a drop down list of other logins that already exist, plus BUILTINS\Administrators.

What do I select in that login box, I can type in ASPNET but it then gives me an error saying 'login doesn't exist'.

Assuming I can eventually get a Login of ASPNET what would I put in the User name.

Cheers,
Bernie|||I think the database user is a red herring, as my local development machine does not have an ASPNET user.

Although there is an ASPNET account for the machine itself, and so I suspect that this is what I need. I have asked the ISP to set one up.

Cheers,
bernie|||you have to select <new> from the list and then it will let you add a new user.|||I tried that but it said I had to be an adminsitrator to complete the task.

Can somebody tell me what exactly needs to be setup on the box?

1. Is it a new user account i.e machinename/ASPNET?
2. Is it a new SQL Server log with name ASPNET?

If no. 1, what happens about the password, how can asp.net use it if doesn't know it?
If no. 2, would it use WIndows Authentication, or an SQL account?

I must say this all seems pretty standard stuff, I can't understand why nobody has come up with a definitive answer. Maybe the ISP i'm using don't know their ASP.NET stuff and they havn't set things up correctly.

Cheers,
Bernie|||when you install vs.net it creates a ASP.NET user account on your system. this is for internet users to login to your comp. but for the aspx pages to access your databases, you still need to add the machinename\ASPNET account inside the SQL Server.

when you select <new> user from the list, another window will come up to fill in the details for the new user.

there would be a button with "..." on it which will bring up all the user accounts on that computer. click on it and you can choose the ASPNET account from the list.
and you can use windows authentication. and dont forget to choose the database.

we usually need not set a password. you can use integrated security in your connection string. something like this :

"server=local;database=Northwind;Integrated Security=SSPI "

and i guess you need to be an admin to create a user account in SQL Server.

HTH|||Thanks, the problem was I couldn't see ASPNET in the drop down list.

All sorted now and working (up to a point), I've some other permission issues to sort out.

Thanks everybody for your help.

Bernie