Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
There's ambiguity here :

the following connection strings :


MySQL

server = ip; database = dbname; uid= username; pwd=password;

now if i change:

server to data source it works.
database to initial catalog it works.
uid to user id or to username it works.
pwd to password it works.


So its now looks like SQL Server connection string ? why that ambiguity between them ?? and whats difference between using server or data source keywords ??

someone tell me please is there any benefits of using ambiguity keywords ?

Now from my point of view SQLSERVER connectionstring = MYSQL connection string.
Posted
Comments
PIEBALDconsult 12-Feb-15 15:09pm    
I wouldn't call it ambiguous. But I agree with trying to use common names as much as possible.
[no name] 12-Feb-15 15:16pm    
but sir tell me the default connection string is good ?
i currently use that for MYSQL :
server = ip; database = dbname; uid= username; pwd=password;

so what you guess. using data source or server ?
PIEBALDconsult 12-Feb-15 15:20pm    
I use Server and Database because it's common with other providers I use, e.g. MySQL .

1 solution

If you consult this extensive list of connection string syntax: http://www.connectionstrings.com/[^], you will notice, that most providers have more than one connection string syntax. And yes, you might find overlapping - altrough you are wrong:
SQL Server standard syntax is:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;<br />
Password=myPassword;

MySQL Standard syntax is what you have posted:
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
So these are not equal, just similar. But what if? Nothing. Not the connection string defines the provider. It is just a string defining parameters. It is up to the provider manufacturer's choice to define this syntax. Could those be harmonized? Yes, maybe. But who would do this?
 
Share this answer
 
v3
Comments
[no name] 12-Feb-15 15:18pm    
yes but in MYSQL connection string i can use user id rather than uid ? and same password rather than pwd ?

but data source is standard in SQlserver i think not server parameter ?


Thanks for your help
Zoltán Zörgő 12-Feb-15 15:19pm    
No you can't mix them. The provider is using those parameters.
[no name] 12-Feb-15 15:29pm    
ok

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900