Crystal Reports in C# - crystal-reports

Actually i try to make the crystal report of my database table values, so far i reached the primary stage of SQL connection. whenever i choose the new connection it seems to produce some errors like,
A network-related or instance0specific error occured while establishing a connection to SQL Server. The serve was not found or was not accessive. Verify that the instance name is correct and that SQL Server is configured to all allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
can anyone pls guide me to generate the crystal report.
Thank you,
Arunkumar M

From the error message you seem want to connect over Named Pipes. Check in SQL Server Configuration Manager if you have enabled Named Pipes
Also you can use PortQueryUI [http://www.microsoft.com/en-us/download/details.aspx?id=24009] to see if your SQL Server is from your location accesible and if it listens on Named Pipes.
Alternatively you could try to connect over TCP/IP port 1433. Also check in SQL COnfiguration Manager if you have TCP/IP enabled and check in PortQueryUI if SQL Servers TCP ports are open.

Related

SchemaCrawler Error opening socket to server DB2 database

I have tried to connect to a DB2 DB using the command line:
schemacrawler --server=db2 --host=*myhost* --port=*myport* --database=*db2database* --user=*myuser* --password=*mypassword* --info-level=minimum --command=list --log-level=CONFIG
I get the following error:
SchemaCrawler 16.11.7
Error: Could not connect to
jdbc:db2://pathtodb:retrieveMessagesFromServerOnGetMessage=true;, for
user 'user', with properties {}: [jcc][t4][2043][11550][4.28.11]
Exception java.net.ConnectException: Error opening socket to server
myserver on port myport with message: Connection timed out: connect. ERRORCODE=-4499, SQLSTATE=08001
I have the suspicion that there is a problem in the company's firewall that does not let me connect from SchemaCrawler. I can connect to the db with DBeaver from a virtual machine (Saas). Since DBeaver is running SaaS I do not have access to the VM and cannot test from there.
How could I check if the network is blocking SchemaCrawler requests from my local machine (Windows 10 Enterprise 1909)?
Windows-10 includes ping and tracert and nslookup tools (you run these in a CMD window). These ping and tracert may help you determine if there is IP-level connectivity between your Win10 box and the target Db2-server. Refer to any good textbook to learn how to use these tools.
Windows-10 also has its own software-firewall ( run from the start box if you search firewall) which needs you to add a rule to open the relevant port for tcp and udp traffic. Your login may need to have suitable permissions to make changes like this, so in some corporate environments access is restricted. If this is the case, open a ticket with relevant support teams, as that is not a matter for StackOverflow.
If adding such a rule does not fix your symptom, then you should contact the network support people in your company to open the relevant ports or provide another means for you to achieve the goal.
Note also that there are other tools (arguably better tools) to get a DDL report for a Db2 database, including the db2look utility which is present in the Db2 fat client, and also present on Db2-LUW servers. If the Db2-server runs on either i-series or Z/OS then other tools exist for those environments so talk with the relevant administrators.

Can't connect to SQL Azure from EF, but can from SSMS

We have an Azure SQL server running which we use for our Azure Web App. The Web App can connect without a problem. We're trying to remotely update the database with the latest EF migrations via a C# console application.
However we get the following exception.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
We tried connecting from the same PC with SSMS and we got in without any problems. And yes, before anyone asks we whitelisted the IP in Azure, else we wouldn't even had access via SSMS. We also tried with and without "tcp:" in the connectionstring.
This is the connectionstring we use in the Web and Console Application:
Server=tcp:{servername}.database.windows.net;Database={dbname};user id = {userid};password = {password};MultipleActiveResultSets=True;
In SSMS we just use {servername}.database.windows.net and use the credentials.
Thanks in advance.
We haven't been able to solve this issue. We instead chose to go with ReadyRoll, which suits us fine.
Azure SQL requires secured connection. You have to add the following to your connection string:
Trusted_Connection=False;Encrypt=True;

SQL Server 2008 R2 ODBC Error: SQL state HTY00

My application server (say 192.168.100.1) and database server (say 192.168.100.2) both are on the same domain. I'm trying to create an ODBC connection from the application server to a SQL Server database on the database server, but at the time of login it generates this error:
Microsoft SQL Server Login
Connection failed:
SQL State: 'HYT00'
SQL Sever Error: 0
[Microsoft][ODBC SQL Server Driver]Login timeout expired
I've checked all configuration for SQL Server and tried possible solutions without resolving this issue.
Important:
A DSN can be successfully created from my own PC but when attempting this server to server as described above, ODBC is facing this problem.
OK, I have got the solution. Sometimes, if SQL Server can't be found on network by its name while creating DSN in windows, the logging in takes time more than usual which tells ODBC manager that Database Server we are looking for is not responding or responding too late.
Solution.
Instead of selecting server from the list while making dsn, use 'server-ip\SQLExpress'.
e.g 192.168.100.2\SQLExpress.
Thats All.

SQL Server 2008 R2 not connect to server

I have installed the SQL server 2008 R2 on windows 7, when i want to connect database engine it give the following error message
TITLE: Connect to Server
Cannot connect to (local).
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476
I tried both window and SQL Server authentication but no success.
please help.
First Check whether any SQL Server Instance is running and exists.
You can check list of instances as per below:
Go to command prompt and type in “osql -L” or “sqlcmd -L”.
If instance is showing in list then check your credentials.
Start the sqlserver service. Nothing to do in stackoverflow. Move question to serverfault.

How does ODBC pull database connection details?

I currently have a Macro which is connecting to a sybase database using ODBC. It's making the connection by running the following:
Set conX = wrkODBC.OpenConnection("Connection1", , True, strConn)
where strConn = "ODBC;DSN=Server_Name;APP=Daily Task;DB=db_name;UID=uname;PWD=pwd;"
The problem I am having is that this connection is working for some Server_Name's but not others. When it doesn't work I get a Error "3146 - ODBC--call failed".
What I don't understand is where it is pulling the server details from. So for example, when using embarcadero rapid to connect to a sybase database, it will use the sql.ini file to pull the server connection details based on the server_name.
I have checked and all the Sybase Servers I am testing are in the sql.ini file and my env variables are pointing to the correct sybase version. I've checked ODBC and it is only picking up a SQL Server driver.
Can anyone please explain how ODBC pulls the server name connection details? I don't understand why it works for some server names, but not others (FYI, I have tested the uname and pwd is rapid to make sure it is correct).
Any information would be much appreciated.
So, the issue was that I was looking at my odbc connections under control panel. I should mention that I am on windows 7. What I had to do was update my ODBC connection details here:
C:/Windows/SYSWOW64/odbcad32.exe
--This is for 32bit!
This had some connections set up which is why I could connect to some servers but not all of them.