I am not an IT professional, and I would like to ask a question related to server connection.
Usually, I use ODBC connection string (such as below sample code), the only reason is: I can view(find out) server database property via Control Panel > Administrative Tools > ODBC Data Sources. Current code works fine for me.
Question: In general, which way of connection is better for MS SQL? Why? What are the difference?
If not using ODBC connection, what are substitutions for OdbcConnection/OdbcCommand/OdbcDataReader etc ?
Thanks.
OdbcConnection/OdbcCommand/OdbcDataReader
OdbcConnection Cn = new OdbcConnection(GlobalVariables.ConnectionString);
Cn.Open();
string QueryM = "SELECT * From TableName";
OdbcCommand cmdM = new OdbcCommand(QueryM, Cn);
OdbcDataReader drM = cmdM.ExecuteReader();
OdbcDataAdapter AdapterTD = null;
DataSet dSetTD = null;