|
I have a ASP.NET website it is hosted on IIS 5 and it works fine' I can browse from IIS console itself
but when I open the same in another client machine, I see the page but no database
it says
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
I checked the named pipes and tcp/ip on sql server and all the permissions are enabled'
I cant find why it shows up on the server but not on the client
plz hlp
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
can you provide code.., how you are conneting to the database..,
Rajesh B --> A Simple Programmer <--
|
|
|
|
|
I do not have the code for this application
it uses an XML file where i have to give the connection details like
<Connection Name="Provider" Value="1" />
<Connection Name="Server" Value="server" />
<Connection Name="Database" Value="db" />
<Connection Name="UserID" Value="user" />
<Connection Name="Password" Value="pwd" />
I do not know how the application uses this
is it a connection problem then so it should not work on the server I think...
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
saud_a_k wrote: <Connection Name="UserID" Value="user" />
<Connection Name="Password" Value="pwd" />
I'm not sure whether the sa-account is enabled by default, and it might even be that 'mixed mode authentication' is disabled.
Create a new console-application, somewhat similar to this;
using System;
using System.Data.SqlClient;
static class SqlTester
{
public static int Main (string[] args)
{
using (SqlConnection con = new SqlConnection(args[0])
{
try
{
con.Open ();
Console.WriteLine ("Connected succesfull, your ConnectionString is correct :)");
}
catch (Exception ex)
{
Console.WriteLine ("Something went wrong:\n" + ex.ToString ());
}
}
}
}
That would give you a small console app that you can use to verify the connection-details.
In this specific case, check whether the customers server have;
- an account with given UserID (should be in the same place as the 'sa')
- allowed mixed mode access (not just Windows-authentication)
- whether the servers' name is correct (express versions are called different than full servers, and they might even be using a named instance)
Good luck
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: an account with given UserID (should be in the same place as the 'sa')
allowed mixed mode access (not just Windows-authentication)
whether the servers' name is correct (express versions are called different than full servers, and they might even be using a named instance)
I checked all these options but I still get the same error
I also gave the location of another server but still the page shows up on the server but not on the client
_____________________________________________________
Yea! I could be wrong...
|
|
|
|
|
saud_a_k wrote: I checked all these options but I still get the same error
Try the connectionstring below, with the console-application from the previous post;
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
If that fails to connect, you'd at least have a more decent error-message to hunt for.
saud_a_k wrote: I also gave the location of another server but still the page shows up on the server but not on the client
If the above method also fails, chances are that there's a connectivity-problem. That means checking if you can 'ping' the clients' server, validating the firewalls and so on. If it's not a connectivity-problem, (security-related problems) then the console-app would generate an error-message indicating where the problem is.
I are Troll
|
|
|
|
|
I'm assuming that the IIS is hosted on the same server as the SQL db? If so, it's making a local connection whereas clients are connecting over the network - based on this make sure that:
1) you have SQL configured to allow the type of connection you are trying to use from the client (IP, pipes, etc.)
2) you have the firewall configured to allow SQL traffic (I've had this problem in the past where the MS firewall didn't automatically add a rule for SQL)
Those are my initial thoughts.
|
|
|
|
|
Hey guys,
I have a SQL Server database in which I want to store history data for a couple of object. However, I don't want the table to keep 'old' data. Therefore I want to have a maximum amount of x (in my case 100) records. Since I have 5 objects available the max numer of records in my table cannot be larger than 500.
The way I accomplish this, is to insert records using a stored procedure. The stored procedure checks the amount of records available for that object. If the amount is larger than 99 it removes (recordamount - 99) records. Then the stored procedure inserts the new value.
Is there a neater way to accomplish this?
Thanks a lot!
Eduard
|
|
|
|
|
Delete from mytable
where ID not in (select top 100 from mytable order bt ID desc)
This works fine and with the minute numbers you are working with it will be Ok, with serious numbers I would have a cleanup job that runs periodically
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I like the idea of a cleanup job that runs periodically.
|
|
|
|
|
That's more like the reply I was looking for. I didn't know if the sp would perform if the cleanup is integrated. A job it is, thanks!
|
|
|
|
|
The only problem with a periodic scheduled job is that you may temporarily find yourself with more rows in the table than you are supposed to have.
A The scheduled job runs and leaves 100 rows in the table
B I insert another row: there are now 101 rows in the table
C At some later point, the job runs again and leaves 100 rows in the table
In between points B and C, you have 101 rows in the table. That may not matter but it may be important. Even if the job is running frequently, you cannot guarantee that a query won't "see" the table between B and C and produce a spurious result.
So, depending on the requirement a scheduled job may be OK if you don't need to guarantee that the row count limit will always be enforced, otherwise a stored proc or a trigger may be the best way to go (although I am not a fan of triggers in general).
|
|
|
|
|
This would be a good example of when to *not* use a trigger. Likely your trigger code is going to select on the very table table that fired the trigger in the first place. Ensuring that this doesn't open the door for unlimited recursion could become difficult. If there is a high water mark of how many rows are allowed, making use of a procedure to enforce that is your best bet. I've seen circular logs where the procedure will update existing records, instead of deleting and inserting something new.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
Well, if your ON INSERT Trigger only deletes records - you aren't going to get a circularity problem.
|
|
|
|
|
Thanks David!
I don't need to guarantee a max number of records.
This[^] post explains what I want my software to do
|
|
|
|
|
Thanks for the reply, but my question was not how to accomplish the removal but wether my solution using a stored procedure was OK.
|
|
|
|
|
I do wonder about the business reason to enforce this record limit, that would drive the decision to use a proc or a scheduled job.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey!
I have 8 servers which I want to report their performance. I use performance counters to aquire system information. Depending on the counter's category and name, I want to counter to store it's value every second, or (if less important) with a lower interval (say a minute).
I want to keep the 100 latest inserted records per performance counter to report the machine's performance. Since some counters store their value each second the database table may grow rapidly. I expect about 160 performance counters running at the same time measuring performance of 8 different servers.
So there's no need to guarantee a max number of records, I can select the latest x records when reporting and a job may clean up the 'old' data. I also may want to switch to keeping the latest 1000 records or something but I don't know about that yet.
I think the job is the best performing solution for this...
Thanks guys!
|
|
|
|
|
Unfortunately, the very act of recording performance data has an impact on system performance. The best approach imho for performance reporting, if possible, is to periodically do performance analysis on the business data recorded by the system during the normal operation.
Kevin Rucker, Application Programmer
QSS Group, Inc.
United States Coast Guard OSC
Kevin.D.Rucker@uscg.mil
"Programming is an art form that fights back." -- Chad Hower
|
|
|
|
|
You could always do this via a trigger on the table - as long as you have some form of feature to sort on to identify older posts.
|
|
|
|
|
I just remembered a third-party system I had to work with a few years ago. There was a particular table that always held 8000 records -- they got reused.
|
|
|
|
|
The neatest way would be to pre-allocate (insert) 100 (or 500) records in your table. Your stored proc should simply update the oldest record using an implicit autocommit transaction. The data type used to determine the oldest record depends on the possible update frequency.
This guarantees your original request of maintaining max x records at all times.
Dwayne J. Baldwin
|
|
|
|
|
Check out RRDtool
http://oss.oetiker.ch/rrdtool/[^]
It's exactly what you need, it's a round robin database (i.e. when it has reached the end, it overwrites the first entries) and it is specifically designed for graphing sensors from various sources (server load, network traffic, temperature sensors, etc).
Good luck!
|
|
|
|
|
Cool, i'll take a peak, thanks a lot!
|
|
|
|
|
I am using C# with mySQL.
I want to know what's the best way to return is_exists value? I use to that with RETURN 999 in SQL Server and handle the value in SqlParameter.ReturnValue
ca you please guide..
Thanks
|
|
|
|