473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Can't open database in browser control

I cannot access my SQL database in a browser control created in my C# Windows
application program I can, however, access the database from an IE browser.
I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE" error
message. I researched all the advice on the internet and tried to add an NT
AUTHORITY\NETWORK SERVICE login to my database under the Security/Users tab
using SQL Server Mangement. However, there is no NT AUTHORITY\NETWORK SERVICE
login in my SQL dialog, only an NT AUTHORITY\SYSTEM login. Why is that?
Secondly, I finally was able to add an NT AUTHORITY\NETWORK SERVICE manually
to my database login and gave it all of the permissions but I still get the
error when accessing the database through my Windows browser control.
Below is my connection string.

Provider=SQLOLEDB; Data Source=Vista; Initial Catalog=Mydatabase;Integrated
Security=SSPI";

Dave
Jul 29 '08 #1
6 1684


You always need to know and be aware of the account you're running under:

Here is some crappy debugging code.

I think the issue is you don't have sql server credentials for the user the
program is running under.

Go to Control Panel / Users and you can see a list of "built in" users that
a windows machine has.

private string FindIIdentity()

{

try

{

string returnValue = string.Empty;

WindowsIdentity ident = WindowsIdentity.GetCurrent();

returnValue = ident.Name;

try

{

returnValue += " on " + System.Environment.MachineName;

}

catch (Exception ex)

{

}

return returnValue;

}

catch (Exception ex)

{

return "Error Finding Identity";

}

}


"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:8C**********************************@microsof t.com...
>I cannot access my SQL database in a browser control created in my C#
Windows
application program I can, however, access the database from an IE
browser.
I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE" error
message. I researched all the advice on the internet and tried to add an
NT
AUTHORITY\NETWORK SERVICE login to my database under the Security/Users
tab
using SQL Server Mangement. However, there is no NT AUTHORITY\NETWORK
SERVICE
login in my SQL dialog, only an NT AUTHORITY\SYSTEM login. Why is that?
Secondly, I finally was able to add an NT AUTHORITY\NETWORK SERVICE
manually
to my database login and gave it all of the permissions but I still get
the
error when accessing the database through my Windows browser control.
Below is my connection string.

Provider=SQLOLEDB; Data Source=Vista; Initial
Catalog=Mydatabase;Integrated
Security=SSPI";

Dave

Jul 29 '08 #2
Thanks for your reply. I inserted your debug code and determined that my
user login was Vista\Dave under VISTA. I add Vista\Dave as a user for my
database and giving it full permission and reran my application and I still
get the NT AUTHORITY error. There has to be something to with the browser
control as I don't get this error in my other Window dialogs in this
application.
Dave

"sloan" wrote:
>

You always need to know and be aware of the account you're running under:

Here is some crappy debugging code.

I think the issue is you don't have sql server credentials for the user the
program is running under.

Go to Control Panel / Users and you can see a list of "built in" users that
a windows machine has.

private string FindIIdentity()

{

try

{

string returnValue = string.Empty;

WindowsIdentity ident = WindowsIdentity.GetCurrent();

returnValue = ident.Name;

try

{

returnValue += " on " + System.Environment.MachineName;

}

catch (Exception ex)

{

}

return returnValue;

}

catch (Exception ex)

{

return "Error Finding Identity";

}

}


"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:8C**********************************@microsof t.com...
I cannot access my SQL database in a browser control created in my C#
Windows
application program I can, however, access the database from an IE
browser.
I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE" error
message. I researched all the advice on the internet and tried to add an
NT
AUTHORITY\NETWORK SERVICE login to my database under the Security/Users
tab
using SQL Server Mangement. However, there is no NT AUTHORITY\NETWORK
SERVICE
login in my SQL dialog, only an NT AUTHORITY\SYSTEM login. Why is that?
Secondly, I finally was able to add an NT AUTHORITY\NETWORK SERVICE
manually
to my database login and gave it all of the permissions but I still get
the
error when accessing the database through my Windows browser control.
Below is my connection string.

Provider=SQLOLEDB; Data Source=Vista; Initial
Catalog=Mydatabase;Integrated
Security=SSPI";

Dave


Jul 29 '08 #3
Yammers.

I don't know then.
My last check would be:

Security / Logins
Databases / MyDatabase / Security / Users
Those are 2 different things in Sql Server.

Now, when you create the login, and ALSO ADD THE "MyDatabase", the "user"
will be auto created.

But I'd check both of those places.
But I don't know. At least you know which user is trying to access the db
under the integrated model.

"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:16**********************************@microsof t.com...
Thanks for your reply. I inserted your debug code and determined that my
user login was Vista\Dave under VISTA. I add Vista\Dave as a user for my
database and giving it full permission and reran my application and I
still
get the NT AUTHORITY error. There has to be something to with the browser
control as I don't get this error in my other Window dialogs in this
application.
Dave

"sloan" wrote:
>>

You always need to know and be aware of the account you're running under:

Here is some crappy debugging code.

I think the issue is you don't have sql server credentials for the user
the
program is running under.

Go to Control Panel / Users and you can see a list of "built in" users
that
a windows machine has.

private string FindIIdentity()

{

try

{

string returnValue = string.Empty;

WindowsIdentity ident = WindowsIdentity.GetCurrent();

returnValue = ident.Name;

try

{

returnValue += " on " + System.Environment.MachineName;

}

catch (Exception ex)

{

}

return returnValue;

}

catch (Exception ex)

{

return "Error Finding Identity";

}

}


"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:8C**********************************@microso ft.com...
>I cannot access my SQL database in a browser control created in my C#
Windows
application program I can, however, access the database from an IE
browser.
I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE"
error
message. I researched all the advice on the internet and tried to add
an
NT
AUTHORITY\NETWORK SERVICE login to my database under the Security/Users
tab
using SQL Server Mangement. However, there is no NT AUTHORITY\NETWORK
SERVICE
login in my SQL dialog, only an NT AUTHORITY\SYSTEM login. Why is that?
Secondly, I finally was able to add an NT AUTHORITY\NETWORK SERVICE
manually
to my database login and gave it all of the permissions but I still get
the
error when accessing the database through my Windows browser control.
Below is my connection string.

Provider=SQLOLEDB; Data Source=Vista; Initial
Catalog=Mydatabase;Integrated
Security=SSPI";

Dave



Jul 29 '08 #4
It really doesn't make any sense. I am getting an error on a login for NT
AUTHORITY yet my Window Identity is Vista\Dave. I think the only way I can
get around it is to provide a user id and password in my connection instead
of using the Integrated Security=SSPI. Looks like a bug to me but I can't
believe I am the only person with this problem.
Dave

"sloan" wrote:
Yammers.

I don't know then.
My last check would be:

Security / Logins
Databases / MyDatabase / Security / Users
Those are 2 different things in Sql Server.

Now, when you create the login, and ALSO ADD THE "MyDatabase", the "user"
will be auto created.

But I'd check both of those places.
But I don't know. At least you know which user is trying to access the db
under the integrated model.

"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:16**********************************@microsof t.com...
Thanks for your reply. I inserted your debug code and determined that my
user login was Vista\Dave under VISTA. I add Vista\Dave as a user for my
database and giving it full permission and reran my application and I
still
get the NT AUTHORITY error. There has to be something to with the browser
control as I don't get this error in my other Window dialogs in this
application.
Dave

"sloan" wrote:
>

You always need to know and be aware of the account you're running under:

Here is some crappy debugging code.

I think the issue is you don't have sql server credentials for the user
the
program is running under.

Go to Control Panel / Users and you can see a list of "built in" users
that
a windows machine has.

private string FindIIdentity()

{

try

{

string returnValue = string.Empty;

WindowsIdentity ident = WindowsIdentity.GetCurrent();

returnValue = ident.Name;

try

{

returnValue += " on " + System.Environment.MachineName;

}

catch (Exception ex)

{

}

return returnValue;

}

catch (Exception ex)

{

return "Error Finding Identity";

}

}


"Parrot" <Pa****@discussions.microsoft.comwrote in message
news:8C**********************************@microsof t.com...
I cannot access my SQL database in a browser control created in my C#
Windows
application program I can, however, access the database from an IE
browser.
I get the ubiquitous "Login failed for NT AUTHORITY\NETWORK SERVICE"
error
message. I researched all the advice on the internet and tried to add
an
NT
AUTHORITY\NETWORK SERVICE login to my database under the Security/Users
tab
using SQL Server Mangement. However, there is no NT AUTHORITY\NETWORK
SERVICE
login in my SQL dialog, only an NT AUTHORITY\SYSTEM login. Why is that?
Secondly, I finally was able to add an NT AUTHORITY\NETWORK SERVICE
manually
to my database login and gave it all of the permissions but I still get
the
error when accessing the database through my Windows browser control.
Below is my connection string.

Provider=SQLOLEDB; Data Source=Vista; Initial
Catalog=Mydatabase;Integrated
Security=SSPI";

Dave


Jul 29 '08 #5
on 29-7-2008, Parrot supposed :
Thanks for your reply. I inserted your debug code and determined that my
user login was Vista\Dave under VISTA. I add Vista\Dave as a user for my
database and giving it full permission and reran my application and I still
get the NT AUTHORITY error. There has to be something to with the browser
control as I don't get this error in my other Window dialogs in this
application.
Dave
Is this "Vista" (from "Vista\Dave") a domain or your local machine?

If it is a domain, does your database server have access to the same
domain?

If it is your local machine, then that database server will not know
about that account. Best to use SqlServer login then (which you need to
enable explicitly in SqlServer as it is disabled by default). You will
need to specify username and password in your connectionstring.

Hans Kesting
Jul 30 '08 #6
The problem is on my local machine and I agree that the only way out of this
problem is to use a user id and password in my connection string. It's not
want I want to do as that requires more programming maintenance but I don't
see any other way around this problem. In summary, I feel this problem is a
bug in disguise and has wasted an awful lot of my time and others trying to
find a solution to something that should be simple.
Dave

"Hans Kesting" wrote:
on 29-7-2008, Parrot supposed :
Thanks for your reply. I inserted your debug code and determined that my
user login was Vista\Dave under VISTA. I add Vista\Dave as a user for my
database and giving it full permission and reran my application and I still
get the NT AUTHORITY error. There has to be something to with the browser
control as I don't get this error in my other Window dialogs in this
application.
Dave

Is this "Vista" (from "Vista\Dave") a domain or your local machine?

If it is a domain, does your database server have access to the same
domain?

If it is your local machine, then that database server will not know
about that account. Best to use SqlServer login then (which you need to
enable explicitly in SqlServer as it is disabled by default). You will
need to specify username and password in your connectionstring.

Hans Kesting
Jul 30 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Dave Holmes | last post by:
Is there a way to keep an other application from opening a link in a browser where I am running an ASP application? For example, I have an ASP application open in a browser. If I click on a link...
3
by: Ryan Ritten | last post by:
Hey, I just started working at this new company and they gave me a simple database project to start with. yet I am starting to look like an idiot cause I can't even seem to connect to the MS...
1
by: Al | last post by:
hi, I am new to asp.net. I have a question about Marshelling b/w client browser and web server(database). I heared that it is better to minimize going back and forth b/w client browser and the...
3
by: Daniel | last post by:
Hi, I have opened the word file from database and display in web browser. When i close the browser, i wan to update the changes into the database. and i dont know how to achieve it. I oni know...
2
by: Steve Franks | last post by:
In ASP.NET 2.0 you can now apparently do this: <asp:label runat="server" text="some browser" IE:text="any IE browser" IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" /> Now the...
6
by: shil | last post by:
I have a server side button that needs to do some preperation and afterwards, if everything goes well, open a new browser with a specific url. I know how to execute javascript from a server side...
2
by: dennist685 | last post by:
Can't open Northwind I remembered doing walkthrough using Northwind. However it wasn't an http project but a file project using the development server. Northwind allowed me to add, edit and...
2
by: jannordgreen | last post by:
I try to run http://localhost/scroller/scrollertest.asp in my IE 6 browser. The asp program tries to connect to a MS Access 97 database. The program works when the database is sitting on any...
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.