w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Database not found error when connecting to Derby network server
By the JDBC url, it's looks like you're trying to connect to a Derby server vs. an embedded instance. If you are trying to connect to a server instance, here are some considerations: did you start the server yourself, did mydb already exists? if not, did you pass in the correct params to create (e.g. ;create=true) example: jdbc:derby://localhost:1527/dbname;create=true if mydb did exists, are you pointing the server to the correct location? also, depending on what was used to start derby (e.g. embedded vs network driver) default database locations are different as well. You can read about it here Basically the exception you're getting is that Derby's saying it can't find your database - it's basically a path issue.

Categories : Java

Error connecting to server in a file
This line: inet_aton(h->h_addr_list[0],&indirizzo_server); is wrong. h_addr_list is not a list of strings in the format that inet_aton expects. It's not even a list of strings at all. It's a list of addresses ready to be copied directly into the appropriate field of the struct sockaddr_*. The char **h_addr_list in struct hostent should be treated as void **, which is what it would be if it hadn't been designed before ANSI C gave us void. A generic pointer is used because gethostby* supports (at least theoretically) arbitrary address families. In the case of h_addrtype==AF_INET, each h_addr_list[n] is a pointer to a struct in_addr, so you can just say indirizzo_server = *(struct in_addr *)h_addr_list[0]; and all will be well.

Categories : C

Error in connecting aspx.cs to database situated in app_data folder [database connection error]
Have you tried localhost as opposed to (LocalDBv11.0), like this? objconn.ConnectionString = "Data Source=localhost;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|test.mdf;User Instance=true;user id=xyz; password=xyz123; Initial Catalog=TEST"; localhost will use TCP, while (LocalDBv11.0) will use Named Pipes

Categories : C#

Connecting to database server using php
This should be basically the mysqli version of what you wrote. <?php $username = "user"; $password = "pass"; $hostname = "creative.coventry.ac.uk"; $mysqli = new mysqli($hostname, $username, $password, "asantec"); $stmt = $mysqli->prepare("SELECT * FROM books;"); $stmt->execute(); $stmt->bind_result($id, $title, $author, $price); //Put all your expected variables here while ($stmt->fetch()) { echo $id.'<br />'; echo $title.'<br />'; echo $author.'<br />'; echo $price.'<br /><br />'; } $mysqli->close(); ?> Also, if you have any issues in the code you've posted, this will work. Check your DB credentials and the data you're querying.

Categories : PHP

connecting to an SQL Server database
The problem your having with regards to connecting to the database on a server is because of SqlConnection dbConnection = new SqlConnection("Data Source=.\SQLEXPRESS;Integrated Security=true"); The best way to do this is to go to your Web.config file and find the block and add a connection to your database in there. eg <add name="ConnectionString" connectionString="Data Source=YOUR SERVER;Initial Catalog=YOUR DATABASE;User ID=YOUR USER ID;Password=YOUR PASSWORD" /> then you can just call the connection string accross your whole project whenever you need to use it. Also with regards to VS2012. There are very few companies using that IDE at the moment so your probably better off learning VS 2010 in the most part but i would agree that VS2008 is fairly out of date now

Categories : C#

Not seeing database from localhost but seeing it when connecting to server
GRANT USAGE is not what you want. According to the mysql documentation: USAGE Synonym for “no privileges” It is used at the global level with GRANT to modify account attributes such as resource limits or SSL characteristics without affecting existing account privileges. http://dev.mysql.com/doc/refman/5.1/en/grant.html You need to grant actual privileges to your "someuser" user for the database the user needs to see. For example, if you grant select privileges on the mysql.*: GRANT SELECT ON mysql.* TO someuser@localhost IDENTIFIED BY "somepassword"; FLUSH PRIVILEGES; Now, someuser connected from localhost will be able to see the mysql database when executing SHOW DATABASES; However, you might want to reserve the access to the mysql database for root only.

Categories : Mysql

Connecting to sql server 2008 database using C#
You connection string is wrong. It should be of this form if you use SQL Server Authentication: Server=myServerAddress;Database=myDataBase;User Id=myUsername; Password=myPassword; Where myServerAddress is the IP or host name of the computer running SQL Server. If it's your PC, localhost will probably work. myUsername and myPassword are the credentials of the user connecting to the server. If you use Trusted Connection,you connection string should be of this form: Server=myServerAddress;Database=myDataBase;Trusted_Connection=True; You can check more examples here: http://www.connectionstrings.com/sql-server/

Categories : C#

sqlsrv error while connecting to mssql server 2008 on windows 2003 server
Two ways to try, first to check if the Native driver has the right version - is your server really a 32bit Version and not 84bit? The other thing is, to check if the extensions are actually loaded. To check that, create a file like "phpinfo.php" and put it in you folder for .htdocs. <?php // show phpinfo file phpinfo(); ?> The easy way is to search for it in the phpinfo-Page with Ctrl+F and "extension=php_sqlsrv_53_ts_vc9.dll"

Categories : PHP

Vb Connecting to an online mysql server database
"I have turned my firewall off but I'm still getting the same error." There is far more filtering going on between you and the destination than your personal firewall, none of which you'll be able to directly disable/change. If the server IP in your example is what you're trying to connect to, then it is very likely a filtering/firewall issue, as cHao mentions. SQL Server's default connection port is tcp/1433, and based on a quick portscan of 188.121.42.33, that host is not accepting connections on tcp/1433: > nc -vv 188.121.42.33 1433 nc: connect to 188.121.42.33 port 1433 (tcp) failed: Connection timed out ...and... > nmap -O 188.121.42.33 Starting Nmap 6.25 ( http://nmap.org ) at 2013-09-05 22:01 ric Nmap scan report for n1nlsmysqladm01.shr.prod.ams1.secureserver.net (188.121

Categories : Mysql

Connecting to a remote database server at run time
I don't know what type of application you're creating. But you can add a key to the config file at runtime and recall it next time the application is run. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings["connectionString"].Value = "<connectionstring>"; config.Save(ConfigurationSaveMode.Modified);

Categories : C#

Batch File Connecting to Server and execute program install on connected server
Here's a little code to help you connect to the SQL server and interrogate the SQL version. @ECHO OFF SQLCMD /? > nul 2> nul IF ERRORLEVEL 1 ECHO.SQLCMD not found on this machine & PAUSE & GOTO :eof SET SQLCmdLine=SQLCMD -b -w400 REM use something like the next line for NT authentication; second line for SQL authentication REM for NT SET SQLCmdLine=%SQLCmdLine% -E -S "YourServerName" REM for SA SET SQLCmdLine=%SQLCmdLine% -U "YourSQLUserName" -P "YourSQLPassword" -S "YourServerName" SET Database=YourDatabaseName REM I will use NT Authentication for this example SET SQLCmdLine=%SQLCmdLine% -E -S "(local)" SET TestSQLCmdLine=%SQLCmdLine% -h-1 -d "%Database%" REM this will get the SQL version %TestSQLCmdLine% -Q "SELECT @@VERSION" | FINDSTR /v "rows affected" REM this will

Categories : SQL

Connecting to SQL Server database using default connection string from C#
This might help you out, change localhost to your address and database name as well.. But Please check sql server must be in running mode { // connection string! SqlConnection myConn = new SqlConnection("Server=localhost\SQLEXPRESS;Integrated security=SSPI;database=Mynewdatabase;"); try { myConn.Open(); Console.WriteLine(myConn ); } catch (System.Exception) { // some exception } finally { if (myConn.State == ConnectionState.Open) { myConn.Close(); } myConn.Dispose(); } } or check out this tutorial

Categories : C#

Connecting to Oracle Database using Sql Server Integration Services
I have had to do this on many occasions, unfortunately the Oracle website is not particularly helpful when trying to determine what you need. You need to download a copy of "ODTwithODAC1120320_32bit.exe" which can be found at: http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html The 64-bit version is of no use, the 32 bit drivers will work just fine. Install this on your development machine and on the SQL Server box if you want to run the packages from the agent. You can then choose the provider ".Net ProvidersOracleCLient Data Provider". The connection string will look some like this (I think 1521 is the default Oracle port): (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=xxxxx)))

Categories : SQL

Java client connecting to PHP server for MySQL database with authentication
Create a PHP file that accepts POST. In your JAVA, try passing a custom header KEY:VALUE pair that's verified via your PHP file - or try to think of a more elaborate way. Then, post along the username and password to the PHP file: POST http://server.com/java-auth.php?user=username&pass=password for pseudo example. Then, have that PHP file return a JSON-encoded string or a serialized string... or go super fancy, and encrypt it all with public/private keys. Hope this helps :)

Categories : Java

Connecting Netbeans 7.3 to Microsoft SQL server Management Studio Express database
You can download at http://www.microsoft.com/en-us/download/details.aspx?id=21599. After download, extract the file. On netbeans (after you open the netbeans application), open form services. On there, you can create new driver with custome. Select file sqljdbc4.jar (at the extract file). Next, you can see the new driver for Microsoft SQL Server 200x. For test connection, right click at the driver. Then, setting in accordance with the form shown

Categories : Java

Parallels Plesk Panel connecting to database server connection string
The error I receive is that the **sql server instance cannot be found**. So, what is the SQL instance name? :) it maybe not ".SQLEXPRESS" but ".SQLEXPRESS2012" or even ".MSSQLSERVER" or anything else.

Categories : Sql Server

Restricting access to one database on SQL Server 2012 when connecting with integrated security
Secure: No. The only thing you can authenticate with SSPI (ie. 'windows Authentication) is the identity of the process connecting. If the two connections connect from the same process then they are indistinguishable. If they are indistinguishable you cannot use GRANT/DENY/REVOKE. If you are looking for something that is not secure (eg. prevent accidental use of the wrong database) then you can rely on APP_NAME(). Emphasis on not-secure, the app_name is just a setting in the connection string can and be spoofed by anyone. It is somehow unusual to share test and production database host (will running test impact production result timing?) and even more so is sharing the test and production client (your Tomcat).

Categories : Sql Server

ODBC Connecting to SQL Database in PHP Error
My thought would be that the ODBC DSN "Vertices" is setup incorrectly on the machine itself. My suggestion would be to try a code similar to: $conn = odbc_connect("Driver={SQL Server Native Client 10.0};Server=YOURSERVERDatabase=DATABASE", 'correctusername','correctpassword'); $query = odbc_exec($conn,"SELECT * FROM tblOrder ...") or die (odbc_errormsg()); Other connection strings, if the above fails, can be found at http://www.connectionstrings.com/sql-server/ My other thought that the user permissions inside the database are not correctly setup to allow correctusername to access the database

Categories : PHP

Error connecting to SQL Azure Database
Step 1: Simplify your connection string. Ours looks like this: <add name="[CONTEXTNAME]" providerName="System.Data.SqlClient" connectionString=" Server=tcp:[SERVER].database.windows.net,1433; Database=[DATABASE]; User ID=[USER]@[SERVER]; Password=[PASSWORD]; Trusted_Connection=False; Encrypt=True; Connection Timeout=30;"/> So looking at your connection string, I would try something like: <add name="MyEntities" providerName="System.Data.SqlClient" connectionString=" metadata=res://*/Model.ModelMy.csdl|res://*/Model.ModelMy.ssdl|res://*/Model.ModelMy.msl; Server=myserver.database.windows.net; Database=MyDatabase; User id=myUser@myserver; Pa

Categories : SQL

Error when connecting to database in unit test
This might not be an answer/solution to your actual problem, but a good tip in general. I strongly recommend not hitting the DB in every unit test, the same applies to the file system and other slow IO operations. Use a simple pattern like the Repository Pattern to abstract away the data access. You can then either implement a fake repository (i.e. backed by a List<T>) or use a mocking framework like moq to setup a mocked repository. By doing this, your tests will run completely in-memory and thus run much faster. You also don't need to care about connection strings and that you always have access to the database.

Categories : Asp Net Mvc

Connecting to an MSSQL database through ODBC Error
Please consult the manual for odbc_connect ex: Consult the manual for odbc_connect, example: <?php // Microsoft SQL Server using the SQL Native Client 10.0 ODBC Driver - allows connection to SQL 7, 2000, 2005 and 2008 $connection = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$database;", $user, $password); // Microsoft Access $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $password); // Microsoft Excel $excelFile = realpath('C:/ExcelData.xls'); $excelDir = dirname($excelFile); $connection = odbc_connect("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=$excelFile;DefaultDir=$excelDir" , '', ''); ?> Also check this tutorial: http://creativedev.in/2011/12/php-odbc-connection-with-mysql/

Categories : PHP

Getting an error when connecting from android to PHP server
There are issues with your PHP. You are not passing back any JSON. You will need to change your script to encode your array into JSON. $result = json_encode($json) Returning the actual JSON will help. Make sure you are not returning any HTML either. Your Java is trying to parse a JSON response, but you are responding with <!DOCTYPE...

Categories : Java

what does "Connecting to database specified by database.yml" in the log file mean?
Check this answer. This may help you. Rails Connecting to database specified by database.yml

Categories : Database

nodejs+express+mongodb: error connecting to database
Have you installed and configured the mongoDB server as detailed here: http://docs.mongodb.org/manual/installation/ Sounds like there is not a MongoDb server running on localhost.

Categories : Node Js

access denied error while connecting to newly restored MDF database
I suspect it may be already attached. Can you connect using: new SqlConnection("Server=" + sqlname + ";Integrated security=SSPI;" + "database=" + dbname);

Categories : C#

secure auth error connecting to SQL server from RMySQL
You may have an old my.cnf configuration on your local machine. You can override the client option secure_auth in my.cnf or in a specific config file you pass to dbConnect() dbConnect(MySQL(), default.file="your-file.cnf" The info on the setting is here: https://dev.mysql.com/doc/refman/5.6/en/mysql-command-options.html#option_mysql_secure-auth As an aside, you should really not be using 4.1-style password hashing :)

Categories : Mysql

"Illegal characters in path" error when connecting to SQL Server
You'll need to escape argil3.mdf Use \ or put an @ before the assignment of the string, for instance. SqlConnection Con = new SqlConnection(@"Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory| argil3.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");

Categories : C#

Error in connecting to PostgreSQL database using data inserted from android application through PHP
check this settings pg_hba.conf This file controls: which hosts are allowed to connect, how clients are authenticated, which PostgreSQL user names they can use, which databases they can access. Records take one of these forms: local DATABASE USER METHOD [OPTIONS] host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS] hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]

Categories : Java

I'm trying to edit a datatable on a SQL server and i keep getting an error about either not accepting a keyword or not connecting due to a timeout
The ConnectionString key in the connectionString section of your web.config is used for an SqlClient.SqlConnection but you specify to use providerName="System.Data.OleDb". You should change to providerName="System.Data.SqlClient" The OleDb client cannot understand that syntax. Then the UPDATE command uses 5 parameters, but you add only one to the Parameters collection. This will be another error, after the opening of the connection. Then in BindGridView you use a connectionstring not defined anywhere, finally the SELECT statement here refers to a table named GridView, I suspect that you have mistyped the correct name of the table (the one used in the update command is called DevTesting ) For the timeout problem you should add the exception message connected to the timeout

Categories : C#

Error while inserting data from SQL server to AS400 database using IBMDASQL provider for linked server
IBMDASQL does support commitment control; it's IBMDA400 that does not (according to the http://www-01.ibm.com/support/docview.wss?uid=nas8N1014514 link). If the table is not journaled, then the transactions must run with commitment control disabled. That's a bad practice. The table should be journaled. If it causes significant performance issues, it's almost certainly because the system is too small for its workload or it's configured poorly.

Categories : Sql Server

Web API controller for uploading a file on the server and save it in my sql server database
This now really becomes a sql server question. You need to store the binary data in a varbinary(max) column. More help here.

Categories : C#

Error: Database server connection limit exceeded in SQL Anywhere. Does this error has anything to do with calling dispose()?
Kevin brought up a good point in the comments. It's easiest to just put your connection in a using statement so it is automatically disposed of when not in use. // connectionString must be set up using (SqlConnection connection = new SqlConnection(connectionString)) { // Do stuff with connection to DB } You were wondering if Dispose needed to ever be called and if it would have an impact on user connection. Actually, the using statement calls Dispose() itself, as you can see here. "The using statement calls the Dispose method on the object in the correct way..." So, I believe your issue may be because your original way of opening/closing the connections left hanging connections. Instead, using the using statement, your connections will automatically be closed once the code leaves th

Categories : C#

Error backup sql database but succeed creating database dump file
The first time you reach this line; $return.= 'DROP TABLE '.$table.';'; ...$return has no value to append to. To get rid of the warning, you'll need to initialize $return (to an empty string probably) before starting the loop.

Categories : PHP

How to send mails by attaching a file (file should be taken from Sql Server Database)
Go through the bellow link http://www.c-sharpcorner.com/uploadfile/rahul4_saxena/send-email-in-Asp-Net-with-attached-file/ and http://www.codeproject.com/Articles/10828/Sending-Email-with-attachment-in-ASP-NET-using-SMT might help you..

Categories : Asp Net

Name of file from SQL Server database
You are reading multiple columns, and you don't have a where clause, so the first problem here is ExecuteScalar - that is designed to read the first column of the first row only. Since that isn't the case here, you should look at ExecuteReader instead. Or a tool that wraps readers, for example "dapper": using(var connection = new SqlConnection("*****")) { var data = connection.Query("SELECT IMAGE,NAME_IMAGE,CODE FROM IMAGES"); foreach(dynamic row in data) { byte[] data = row.IMAGE; // yes, as simple as that string name = row.NAME_IMAGE; //... do something with data / name } } or via raw ADO.NET: using(var connection = new SqlConnection("*****")) using(var cmd = connection.CreateCommand()) { cmd.CommandText = "SELECT IMAGE,NAME_IMAGE,CODE FROM

Categories : C#

Can not connect to SQL Server database file
Your connection string is specifing an invalid path to the database file. Simply remove the first / string connectionString = @"Data Source=StorageComments.sdf;Persist Security Info=False;"; SqlCeConnectionconnection = new SqlCeConnection(connectionString); connection.Open(); be sure to reference System.Data.SqlServerCe

Categories : C#

Restoring SQL Server database using just the MDF file without LDF
You can try attaching the MDF by right clicking on databases in SSMS, and deleting the reference to the log file location in that dialog, and a new one will be created, assuming the MDF is not corrupt.

Categories : SQL

Copy data from local production SQL Server database to remote read only SQL Server database
I think the logshipping solution fits your needs. After a one-time setup proces, the logs would be continually shipped from the local db to the remote db. Keeping the remote perfectly in sync with the local one, providing you with the readonly copy. Logshipping is available in all editions, besides Express. There would be no need for a continuous restore process. You can find more information here.

Categories : Sql Server

JSP - connecting to a database
Your intuition is right. You should not connect from the JSP directly to the database, if that is even possible. Most programs consist of several layers. For example: You have the DAO (Data Access Object) which has one responsibility: getting data from the database. It does not care what happens with that data, but it retrieves it. Then you have the service layer which does business logic, calculations, etc. It does not care where the data comes from, it just assumes the data is there (but it is from the dao) Then you have the user interface layer which prepares the information to be used in JSP's, does transformations that the JSP cannot do, filter out information that is not required, etc. And once again, it does not know anything about where the data comes from, it just gets it from

Categories : Java

PHP: Not connecting to database
You need to add "" around the fields you are about to insert. You presently have: $query="INSERT INTO user (fname, lname, username, password)"."VALUES('$fname', '$lname', '$username', '$password_hash')"; Do this instead: $query='INSERT INTO user (fname, lname, username, password) '. 'VALUES("'.$fname.'", "'.$lname.'", "'.$username.'", "'.$password_hash.'")';

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.