Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Friday, February 24, 2012

aspnetdb on host, connection string

Hi

I am having trouble connecting to aspnetdb on the shared host. On my local server this is my connection string which works fine:

<addname="MyLocalSqlServer"connectionString="Data Source=.\SQLExpress;Integrated Security=SSPI;Initial Catalog=aspnetdb;User Instance=false"

providerName="System.Data.SqlClient" />

But, this doesn't work on the host (just putting in host address):

<addname="MyLocalSqlServer"connectionString="190.40...232,1444;Integrated Security=SSPI;Initial Catalog=aspnetdb_booksale;User Instance=false"

providerName="System.Data.SqlClient" />,

and I get the error :

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

so I put in the user id and password that i used when I created the aspnetdb_booksale db

<addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

providerName="System.Data.SqlClient" />

and I get the error:

The ConnectionString property has not been initialized.

Any ideas for me?

Amanda

Hi

My problem is not the connection string, because the one below works when I use the add user wizard. However, I get the error when I use the "createuser.membership" method. Funny tho it worked on my local server...

<addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

|||

So you mean you got the "The ConnectionString property has not been initialized" when you connect from remote machine using the connection string below?

addname="MyLocalSqlServer"connectionString="Data Source=196...232,1444;Integrated Security=False;User ID=aspnetdbbooksale; password=amanda;Initial Catalog=aspnetdb_booksale;User Instance=false"

Really strange. Every time you got the same error message?

ASPNET user

I just moved my website to a shared host, and I face some trouble.
Since there is more than one DB on the SQL server they don't want to create a ASPNET user. Is there a way to make my SQLCommand use my user name instead of ASPNET ?

Otherwise, can anyone explain to me the result of the ASPNET user on other website who will use the same server as me security wise ?in your connection string, just define the user name and password they assigned you for SQL Server access.|||That's what I do, but when I try to run a stored procedure, I get a security error saying ASPNET user need to have execute access on the SP.

Sunday, February 12, 2012

ASP.NET connecting to MSDE

G'day,
I'm very new to ASP.NET (but not to programming) and I'm having some trouble with connecting to a database.

I am using C#.NET and I dragged the SqlConnection component onto the form, set the connection string to (local) and to use integrated security, and on that data link properties page I can press the test connection and it works fine, and I can see the databases in "select database on server" drop down box... but when I try and Open() the connection I get a

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'AMD2500\ASPNET'.

Can anyone help me?

Thanks,
RobboIf you want your web app to impersonate the user, you need to have the following two sections in web.config:

<configuration>
<system.web>
<identity impersonate="true"/>
<authentication mode="Windows" />
</system.web>
</configuration>