Thursday, February 9, 2012

Access denied sometimes

I use C#, .Net to connect to SQL Server2000 and Sybase to do work in the program:
1. Connect to SQL Server;
2. Connect to Sybase;
3. Connect to SQL Server again;
the program runs every 5 miniutes. But sometimes it displays error message in the 3rd step:System.Data.OleDb.OleException:[DBNetLib][ConnectionOpen[Connect()].]SQL Server does not exist or access denied.

just how it goes?
Note: It does not display the error message always, DO just sometimes. Such as It can run properly the first time with all the three steps, but failed when the 2rd round goes. Why?

any help would be really appreciated!
thanks u.

JeffWhat is the default netlib used?
Any firewall involved?|||also, what have you observed when running SQL profiler?|||1. sorry, i know little about dbnetlib, i just notice the connectionstring was assgined to IDBConnection. Is it ole or sql or something about?
2. no firewall.

3.it was failed in the production server, after several failure, the program was replaced with the old version. at that time i didn't use sql profile to observe it.
maybe i can try this.

thanks you all.
Jeff
Note: erver time it runs, the error message display with the 3rd step only. And i have remembered that the first time it runs properly.

thanks.|||May be my post should be elaborated, netlib is the default client network library used on Server. You can get details from Programs --> MSSQL 7 --> Server network utility.

As Paul referred by running PROFILER you will get details during this process and where its failing with error.|||thank u satya.

i don't know what's the default netlib i used. It was installed in a machine i have no account to login in.

I used oledb to connect to it, maybe the netdblib is tcp/ip, i think.

when i run the 3rd step independently, the error message display again.
yes, i used sql profile and got the following:
the program got too many row data that would be imported into sql server. but due to the business logic, every row data should be checked from the sql server whether or not it can be added into. the db connection has beed designed to new and close a new transaction and connection each time for every check.
in the profile, or it goes right, or when the error message displays, it stopped at random row data -- i ran the program serveral times.
i also notice the memory goes up quickly, the test data i used took at about 350M memory. and i also noticed that the error goes up, the system (i don't know what it is, but maybe the .net framework) is so busy, the usage memory is decreasing, every thing gots so slowly, after a while, the error message displays. ps: the error display at random position row in the data or the program goes right with no error displays.

thanks again, sayta.
I'm still figuring out the reason... Jeff

No comments:

Post a Comment