Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Wednesday, March 21, 2012

promblems connecting to db across a network

Hello,

I've built an application using c#, visual studio 2005 and sql server 2000. The database is sitting on another machine on the network.

When I test the application from visual studio, it all works fine - no problems connecting to the database etc.

However, If I publish the website and move it to the same server as the database and set up the site and users through IIS etc, I get the following error

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

my connection string is

<connectionStrings>

<addname="cashinsConnectionString"connectionString="Data Source=Londevs;Initial Catalog=cashins;User ID=Cash; Password=Cash123;"

providerName="System.Data.SqlClient" />

</connectionStrings>

Anyone have any ideas why this is happening?

Thanks

fogofogo:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE

You are trying to connect to the database with the above account which doesn't have the necessary permissions to connect.

|||

Thanks for your reply.

So do I need to set these permissions on the database or on the server where the database is sitting?

|||

actually - this is strange. I've just put together a smaller application with the EXACT same connection string as above, and it worked fine.

how could that be??Confused

|||

It's most likely a problem with your web.config file (possibly it's doing some impersonation or windows authentication) rather than just the connection string. Check both web.config files to see what you are doing differently.

|||

Thanks.

I compared them both using winmerge and they are both the same.

here my config file

12<!--3 Note: As an alternative to hand editing this file you can use the4 web admin tool to configure settings for your application. Use5 the Website->Asp.Net Configuration option in Visual Studio.6 A full list of settings and comments can be found in7 machine.config.comments usually located in8 \Windows\Microsoft.Net\Framework\v2.x\Config9-->10<configuration>11<appSettings/>12<connectionStrings>1314 <add name="cashinsConnectionString" connectionString="Data Source=servername;Initial Catalog=databasename;User ID=Cash; Password=Cash123;" providerName="System.Data.SqlClient"/>15 </connectionStrings>16 <system.web>17<!--18 Set compilation debug="true" to insert debugging19 symbols into the compiled page. Because this20 affects performance, set this value to true only21 during development.22 -->23<compilation debug="true"/>24<!--25 The <authentication> section enables configuration26 of the security authentication mode used by27 ASP.NET to identify an incoming user.28 -->29<authentication mode="Forms"/>3031<!--32 The <customErrors> section enables configuration33 of what to do if/when an unhandled error occurs34 during the execution of a request. Specifically,35 it enables developers to configure html error pages36 to be displayed in place of a error stack trace.3738 <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">39 <error statusCode="403" redirect="NoAccess.htm" />40 <error statusCode="404" redirect="FileNotFound.htm" />41 </customErrors>42 -->43</system.web>44</configuration>

all looks ok right?

I also pass the connection through...

1private static String connstring = ConfigurationManager.ConnectionStrings["cashinsConnectionString"].ConnectionString;2private static SqlConnection conn =new SqlConnection(connstring);

so I can access the connection from a .cs file that holds my classes and methods etc. Could that be the source of the problem?

Thanks

|||

Hi,

From your description, it seems that you application can connect to your database while lunched from Visual Studio but failed when lunched in IIS, right?

You can try the following steps to check if "AUTHORITY\NETWORK SERVICE" has been permitted to visit the database.

1. Open your Enterprise Manager and open the security node in your local sql server.
2. Click on "Logins", try to see if "AUTHORITY\NETWORK SERVICE" appeared in that list, if not, create the user and assign the corresponding server roles.

Thanks.

|||

Cool! thanks

Tuesday, March 20, 2012

Progress indicator for Neural Network training...

I am in the process of training a Neural Networks, which could take significant iterations in the process of getting trained. While using other tools like I can visually see the convergence (in terms of error for the model). Is there a way to see any progress while training while using Analysis Server - Neural Network training? It would be useful to see the accuracy, interation number and timeout while in the process of training etc...

Thanks

Rajeev Gupta

Hello

The progress notifications for Neural Networks will be somewhat improved for the next Service Pack of SQL Server 2005. However, there is still no simple way to display the information you requested. We consider this as an improvement for the next version.

Meanwhile, there is a way to filter the notifications and obtain at least part of the information:

The "Tracing Mining Model Processing Using AMO" article at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/3615.aspx contains information (and a code sample) on how to trace the notifications emitted during the processing of a mining model. Among the "Reading cases..." notifications there are some looking like "Training the subnet. Holdout error = ...".

The sample application can be slightly modified to filter out events that do not look like "Training the subnet....". One such notification is emitted after each iteration and the holdout error is included in the notification.

Hope this helps

Monday, February 20, 2012

program return blank set

Hi NGs,
I have a program connecting to SQL Server as the back-
end, recently, our company change to use FDDI instead of
128K network line; this causes the program return blank
Set from the SQL Server. We don't modify the program, the
only change is the networking situation. From 128k line
to FDDI; the program worked fine for about 1 month before
we made the change; FDDI also works great except this
program. Do you have any idea?
TIA.Are you able to make a connection to the SQL Server outside of the
application using tools SQL Query Analyser or OSQL.
HTH
Ryan Waight, MCDBA, MCSE
"Matt" <spam@.spam.com> wrote in message
news:079801c3ae80$22a1ecb0$a301280a@.phx.gbl...
> Hi NGs,
> I have a program connecting to SQL Server as the back-
> end, recently, our company change to use FDDI instead of
> 128K network line; this causes the program return blank
> Set from the SQL Server. We don't modify the program, the
> only change is the networking situation. From 128k line
> to FDDI; the program worked fine for about 1 month before
> we made the change; FDDI also works great except this
> program. Do you have any idea?
> TIA.
>
>
>|||thanks, currently I don't know, I will try it, if it
connects successfully, how do I process in next step?
>--Original Message--
>Are you able to make a connection to the SQL Server
outside of the
>application using tools SQL Query Analyser or OSQL.
>
>--
>HTH
>Ryan Waight, MCDBA, MCSE
>"Matt" <spam@.spam.com> wrote in message
>news:079801c3ae80$22a1ecb0$a301280a@.phx.gbl...
>> Hi NGs,
>> I have a program connecting to SQL Server as the back-
>> end, recently, our company change to use FDDI instead
of
>> 128K network line; this causes the program return blank
>> Set from the SQL Server. We don't modify the program,
the
>> only change is the networking situation. From 128k line
>> to FDDI; the program worked fine for about 1 month
before
>> we made the change; FDDI also works great except this
>> program. Do you have any idea?
>> TIA.
>>
>>
>>
>
>.
>|||Hi Matt,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
your issue.
I am a little confused about the statement "blank set" you mentioned, it
will be more helpful if you could provide more specific description about
it. I assume that your application cannot get any data from the SQL Server
through the network of your company that used to work well. From the
information you provided, the only change that happened in you application
environment is the FDDI network took place of the formal 128K network,
right? If I have misunderstood, please feel free to let me know.
From my experience, you should confirm the connectivity of your computer
and the remote SQL Server first. You'd better use the Query Analyzer on
your computer and execute a simple query statement to see if the Query
Analyzer could retrieve any data from the remote SQL Server. This will be
helpful to confirm that both the remote SQL Server and the communication
between you computer and the remote SQL Server are working well.
Please let me know if the Query Analyzer could get data from the remote SQL
Server and I will provide further support based on the information you
provided. Looking forward to your response
Sincerely Yours
Baisong, Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.
--
| Content-Class: urn:content-classes:message
| From: "Matt" <spam@.spam.com>
| Sender: "Matt" <spam@.spam.com>
| Subject: program return blank set
| Date: Wed, 19 Nov 2003 01:33:05 -0800
| Lines: 18
| Message-ID: <079801c3ae80$22a1ecb0$a301280a@.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOugCKhWxDbVERgQq6h62CYlPL2YA==| Newsgroups: microsoft.public.sqlserver.server
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:317195
| NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| Hi NGs,
|
| I have a program connecting to SQL Server as the back-
| end, recently, our company change to use FDDI instead of
| 128K network line; this causes the program return blank
| Set from the SQL Server. We don't modify the program, the
| only change is the networking situation. From 128k line
| to FDDI; the program worked fine for about 1 month before
| we made the change; FDDI also works great except this
| program. Do you have any idea?
|
| TIA.
|
|
|
|
|
|
|