Connection string means , a string of parameters that is required to establish a connection to the Remote/Local database .
This will contain User name , Password,Server name etc
Some hosting servers , the database will be on another server , so we need to put that server name/ servers IP . Else we just put the db server as local host .
User name- is the Username created with DB
Eg : ASP.net C# with MS SQL 2008
con.ConnectionString = "server=localhost;database=DB_MLIFE;uid=sa;pwd=admin";
Where con is the object of connection
private SqlConnection con = new SqlConnection();
My SQL with php Connection string
mysql_connect(servername,username,password);
<?php
$con = mysql_connect("localhost","John","admin123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
?>
No comments:
Post a Comment