Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computer Certification > MCSD > SQLDataConnection

Reply
Thread Tools

SQLDataConnection

 
 
=?Utf-8?B?UGFwcmkgQ2hha3Jhdm9ydHk=?=
Guest
Posts: n/a
 
      06-02-2004
hello
I have been trying to test a code to connect to an sqlserver database
all i have done is used a datagrid to display some data from pubs databse in sqlserver
i have used sqlconnection, sqldataadapter. i have writted code under page load a
sqldataadapter1.fill(dataset1
datagrid1.databind()
when i build and browse the page, I get the message
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Can you guys explain what is happening? It is really frustrating
Thanks Papri
 
Reply With Quote
 
 
 
 
Alex
Guest
Posts: n/a
 
      06-02-2004
Hi. Try and check the user and password or the type of authentication on
your connection string.

Alejandro.


"Papri Chakravorty" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> hello,
> I have been trying to test a code to connect to an sqlserver database.
> all i have done is used a datagrid to display some data from pubs databse

in sqlserver.
> i have used sqlconnection, sqldataadapter. i have writted code under page

load as
> sqldataadapter1.fill(dataset1)
> datagrid1.databind().
> when i build and browse the page, I get the message,
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL

Server connection.
> Can you guys explain what is happening? It is really frustrating.
> Thanks Papri



 
Reply With Quote
 
 
 
 
Jay Walters
Guest
Posts: n/a
 
      06-02-2004
This is about db permissions.

If you're using a username and password:

Enterprise Mgr, right click on local SQL Server instance
[or what ever instance you're using], I think it's the
security tab - make sure that you have mixed mode turned
on (Windows auth and SQL password)

If you're using an windows auth: then make sure that your
local ASPNET user has permissions to the database.


>-----Original Message-----
>hello,
>I have been trying to test a code to connect to an

sqlserver database.
>all i have done is used a datagrid to display some data

from pubs databse in sqlserver.
>i have used sqlconnection, sqldataadapter. i have

writted code under page load as
>sqldataadapter1.fill(dataset1)
>datagrid1.databind().
>when i build and browse the page, I get the message,
>Login failed for user '(null)'. Reason: Not associated

with a trusted SQL Server connection.
>Can you guys explain what is happening? It is really

frustrating.
>Thanks Papri
>.
>

 
Reply With Quote
 
Jay Walters
Guest
Posts: n/a
 
      06-02-2004
Looking at your error - [as Alex mentioned] your
connection string doesn't have a user specified.

>>Login failed for user '(null)'






>-----Original Message-----
>This is about db permissions.
>
>If you're using a username and password:
>
>Enterprise Mgr, right click on local SQL Server instance
>[or what ever instance you're using], I think it's the
>security tab - make sure that you have mixed mode turned
>on (Windows auth and SQL password)
>
>If you're using an windows auth: then make sure that

your
>local ASPNET user has permissions to the database.
>
>
>>-----Original Message-----
>>hello,
>>I have been trying to test a code to connect to an

>sqlserver database.
>>all i have done is used a datagrid to display some data

>from pubs databse in sqlserver.
>>i have used sqlconnection, sqldataadapter. i have

>writted code under page load as
>>sqldataadapter1.fill(dataset1)
>>datagrid1.databind().
>>when i build and browse the page, I get the message,
>>Login failed for user '(null)'. Reason: Not associated

>with a trusted SQL Server connection.
>>Can you guys explain what is happening? It is really

>frustrating.
>>Thanks Papri
>>.
>>

>.
>

 
Reply With Quote
 
Daniel Joskovski
Guest
Posts: n/a
 
      06-02-2004
First uncheck anonymous access in directory security tab of IIS, then in
web.config put element <impersonate="true"> that will allow to connect to
SQL server under your account.

Regards,
Daniel
"Papri Chakravorty" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> hello,
> I have been trying to test a code to connect to an sqlserver database.
> all i have done is used a datagrid to display some data from pubs databse

in sqlserver.
> i have used sqlconnection, sqldataadapter. i have writted code under page

load as
> sqldataadapter1.fill(dataset1)
> datagrid1.databind().
> when i build and browse the page, I get the message,
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL

Server connection.
> Can you guys explain what is happening? It is really frustrating.
> Thanks Papri



 
Reply With Quote
 
The Poster Formerly Known as Kline Sphere
Guest
Posts: n/a
 
      06-03-2004
>First uncheck anonymous access in directory security tab of IIS, then in
>web.config put element <impersonate="true"> that will allow to connect to
>SQL server under your account.


More importantly, the person who posted the original question, should
gain an understand the consequences of such actions,

Kline Sphere (Chalk) MCNGP #3
 
Reply With Quote
 
Daniel Joskovski
Guest
Posts: n/a
 
      06-03-2004
Agreed, thanks for suggestion.
This is common situation when first try to do something under ASP.NET, if
anonymous user access is allowed that mean the user is not authenticated,
attempt to obtain trusted connection will fail, but only disallowing
anonymous access is not solution, because after that IIS will authenticate
ASPNET user account which not have any permission in sql database and it's
smart to live that way. To solve problem you need to impersonate ASPNET
account to be Your user account ( which account can have trusted connection
with SQL server), that can be done in web.config specifying
<identity impersonate="true" />

Regards,
Daniel

"The Poster Formerly Known as Kline Sphere" <.> wrote in message
news:(E-Mail Removed)...
> >First uncheck anonymous access in directory security tab of IIS, then in
> >web.config put element <impersonate="true"> that will allow to connect to
> >SQL server under your account.

>
> More importantly, the person who posted the original question, should
> gain an understand the consequences of such actions,
>
> Kline Sphere (Chalk) MCNGP #3



 
Reply With Quote
 
Jay Walters
Guest
Posts: n/a
 
      06-04-2004
I don't think that's what he was trying to do

I think he's a total newbie and just doesn't have a
proper connection string...

The error is : >> Login failed for user '(null)'.

If he was having trouble connecting with the ASPNET
account - it would say failed for <LOCAL>\ASPNET



>-----Original Message-----
>First uncheck anonymous access in directory security tab

of IIS, then in
>web.config put element <impersonate="true"> that will

allow to connect to
>SQL server under your account.
>
>Regards,
>Daniel
>"Papri Chakravorty"

<(E-Mail Removed)> wrote in message
>news477AE02-7FE5-4751-B172-

http://www.velocityreviews.com/forums/(E-Mail Removed)...
>> hello,
>> I have been trying to test a code to connect to an

sqlserver database.
>> all i have done is used a datagrid to display some

data from pubs databse
>in sqlserver.
>> i have used sqlconnection, sqldataadapter. i have

writted code under page
>load as
>> sqldataadapter1.fill(dataset1)
>> datagrid1.databind().
>> when i build and browse the page, I get the message,
>> Login failed for user '(null)'. Reason: Not associated

with a trusted SQL
>Server connection.
>> Can you guys explain what is happening? It is really

frustrating.
>> Thanks Papri

>
>
>.
>

 
Reply With Quote
 
The Poster Formerly Known as Kline Sphere
Guest
Posts: n/a
 
      06-05-2004
Which relates to two other threads posted here recently and highlights
why security in software development on ms platforms, is simply not
taken seriously. My point is quite simple, security and software
development goes hand in hand, always has (to a lesser extent may be)
and always will.

The first one: -

<quote poster='Moe'
Message-ID='14c5f01c44597$bb8b3fe0$(E-Mail Removed)'
Subject='Re: Training and Career'>

Very true. But I still question the value in taking the
time to get certified in those areas if the ultimate
objective is getting work in development.

Let's face it. There's sort of an "overhead" involved in
taking and passing the tests that's somewhat incidental
to any real learning process. You have to try to get hip
to what the exam is going to focus on - probably run
through some practice tests, etc. (I know you don't
approve, Kline - spare us - OK?). That's all time that
could be spent learning something important.

</quote>

... second one: -

<quote =poster='The Poster Formerly Known as Kline Sphere'
Message-ID='(E-Mail Removed)'
Subject='Re: No news from 70-330/340??'>

As I've said before, I can't understand why these exams were not never
part of the dot net certification track. That will change, but why so
long?

The way security is ignored in software development on the ms platform
has always been mad.

To me, one of few reason to move to dot net, is the excellent
improvement to code based security over the traditional, non dot net
development tools. Again I can't understand why this was not promoted
in the certification process, until now.

</quote>

On Fri, 4 Jun 2004 01:11:31 +0200, "Daniel Joskovski"
<(E-Mail Removed)> wrote:

>Agreed, thanks for suggestion.
>This is common situation when first try to do something under ASP.NET, if
>anonymous user access is allowed that mean the user is not authenticated,
>attempt to obtain trusted connection will fail, but only disallowing
>anonymous access is not solution, because after that IIS will authenticate
>ASPNET user account which not have any permission in sql database and it's
>smart to live that way. To solve problem you need to impersonate ASPNET
>account to be Your user account ( which account can have trusted connection
>with SQL server), that can be done in web.config specifying
><identity impersonate="true" />
>
>Regards,
>Daniel
>
>"The Poster Formerly Known as Kline Sphere" <.> wrote in message
>news:(E-Mail Removed).. .
>> >First uncheck anonymous access in directory security tab of IIS, then in
>> >web.config put element <impersonate="true"> that will allow to connect to
>> >SQL server under your account.

>>
>> More importantly, the person who posted the original question, should
>> gain an understand the consequences of such actions,
>>
>> Kline Sphere (Chalk) MCNGP #3

>



Kline Sphere (Chalk) MCNGP #3
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments