I have this program in java to connect to a SQL Server
server = "ZF-SQL-MTRAZDB.NIS.LOCAL"
dbName = "MRAZ"
nameBaseDatos = "CD_LO"
table = "dbo.CD_LO_DATA"
user = "user"
password = "Pass"
url = "jdbc:sqlserver//"+ server + "\\" + dbName + "jdatabaseName=" + nameBaseDatos
driver = "com.microsoft.sqlserver.jdbc_SQLServerDriver"
Now I have to do the same with Visual C# 2010 in Windows XP
How can I do this program?? Because in java use JDBC, Should I also use JDBC?
Thanks for all!
The ConnectionString is similar to an
OLE DBconnection string, but is not identical. Unlike OLE DB or ADO, the connection string that is returned is the same as the user-setConnectionString, minus security information if the Persist Security Info value is set to false (default). The .NET Framework Data Provider forSQL Serverdoes not persist or return the password in a connection string unless you set Persist Security Info to true.You can use the
ConnectionStringproperty to connect to a database. The following example illustrates a typical connection string.Use the new SqlConnectionStringBuilder to construct valid connection strings at run time.
Data SourceorServer orAddressorAddrorNetwork Address: The name or network address of the instance of SQL Server to which to connect. The port number can be specified after the server name :server=tcp:servername, portnumber`Initial CatalogorDatabase: The name of the database. The database name can be 128 characters or less.Integrated SecurityorTrusted_Connection: Whenfalse,User IDandPasswordare specified in the connection. When true, the current Windows account credentials are used for authentication. Recognized values are true,false, yes, no, andsspi(strongly recommended), which is equivalent totrue. IfUser IDandPasswordare specified and Integrated Security is set to true, theUser IDandPasswordwill be ignored andIntegrated Securitywill be used.and other items
I hope this help you :) .