We have an .net standalone(windows) application which connects to SQL AnyWhere (Sybase) using ODBC connection. In this application fist we create temporary tables and then we push the data from these temporary tables to the actual production tables. This is the overview of my application. We have tab delimited text files using which we create the tables and insert the data to database. I am creating these tables and inserting the data to the tables from .net application(using odbc). what happens is for sometime the application is running perfectly fine its creating the tables and inserting the data to temp tables , but after sometime am getting an error as ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Database server not found. This is happening on the production server only. Am not receiving these errors when am testing or running the code locally. Am really frustrated with this not getting any of the solutions . Please any one of you can guide me on this issue and let me know the possibilities or work around Regards, Satish |
Which version of SQL Anywhere are you using?
Is there a particular reason that you are not using the ADO.NET driver? It should have better performance for you from .NET:
http://dcx.sybase.com/index.html#sa160/en/dbprogramming/adodotnet-development.html
This will be the message returned back to the database client. Is the database server still running after you receive this error, or did it stop/crash?
On the database server, enable the console log file to record the information when the client gets disconnected: (e.g.
dbsrv16 -z -o console.txt ...
) to see what happens on the server-side when you receive this error.First of all Thanks Jeff Albion for your reply. Below 1.We are using sqlanywhere11. 2.And we do have database profiles created in ODBC Administrator that is the reason we are using ODBC. 3.Database server is in running mode when we receive this error i mean its not crashing or stopping.
Please advice
And one more as i said earlier am creating and inserting these tables using flat/tab-delimited text files. Am getting this error for specific tables only. I mean how many times I run the application am getting this database server not found issue for specific tables only. Is this anyway related to the text files or related to the server.
Can you post some sample .NET code of how you are trying to insert the data files from your application?
How are you creating/maintaining connections to SQL Anywhere from your .NET program?
The ADO.NET provider can also refer to ODBC entries in order to obtain the connection information in its connection string. (e.g.
Data Source=SQL Anywhere 11 Demo
).below is the code for inserting data am passing the insert query in sqlstring. if (sqlString != string.Empty) { oDBHelper.ExecuteNonQuery(CommandType.Text, sqlString); sb = new StringBuilder(); sqlString = string.Empty; }
execute non query to open and insert data
public int ExecuteNonQuery(CommandType cmdType, string cmdText) { try {
Below is the connection to open database.
public void EstablishFactoryConnection() { / // This check is not required as it will throw "Invalid Provider Exception" on the contructor itself. if (0 == DbProviderFactories.GetFactoryClasses().Select("InvariantName='" + S_PROVIDER + "'").Length) throw new Exception("Invalid Provider"); / oConnection = oFactory.CreateConnection();
Thank you for posting the .NET portion - although, this unfortunately is not enough information to be illustrative of the problem. When we ask for customers to post sample code, the idea is that we can take the sample code and easily run it on another installation to see the same issue. Currently, this code does not contain the following auxiliary information needed to reproduce an issue:
sqlstring
) you're using to insert data with.utils.DBMgr.ConnectionStr
) you're using.Also, which specific build of SQL Anywhere 11 are you using for both the database server and the ODBC driver? (e.g. 11.0.1.2960).
If the code is currently commented out and not required to reproduce the issue, it is best to remove the section before posting to avoid confusion.
If this code works in general (on your local machine) and if you only require direct assistance with a certain network environment that doesn't work, it would likely better to open a technical support case, so we can assist with collecting the specific details of what you're trying when you see this error message.
Client debug logging might be helpful. Add LogFile=<filespec> to the connection parameters for the problematic connections. This should provide more detail of the cause.