OK, you seem to be confused about a ton of stuff.
First, NEVER put a connection string inside your code. ALWAYS put it in the applications .config file. This is because WHEN the SQL Server name changes, like when you go from a dev machine and deploy to a production machine, the server name WILL CHANGE.
Next, you don't seem to understand the parameters in a connection string. For an SQL Server connection string, "Data Source" is the name of the server that is running SQL Server and, optionally, the name of an SQL Server instance. In your case, the "." means that the SQL Server is expected to be running on the same machine as your code. Is that the case? Probably not.
Next, the "Initial Catalog" is the name of the database you're connecting to. Is your database on the SQL Server called "ecommerceDBConnectionString1". Probably not.
Lastly, in your case, "Trusted Connection" is an option telling the connection to authenticate to the SQL Server using the account that your code is running under. On your dev machine, the code runs as YOU. On a server, it runs as whatever account is setup specifically to the the code, usually the default ASP.NET account. This account rarely ever has a valid login to an SQL Server.
For you, a connection string would probably look more like this:
Server=serverName;Database=databaseName;User Id=sqlServerAccount;Password=password;
But, the exact syntax depends on what Provider you're using.
Bottom line is you REALLY need to do your homework on what a connection string is and what your options are for connection to an SQL Server.