M
Mullin Yu
hi,
i write the following code, but will the db resource be released?
i noted that at the SQL Server's Process Info that my application seems
generate lots of Process with new ProcessID, will it be removed if the
application runs Dispose() method.
or i better not to use Adapter
OleDbDataAdapter DataAdapter =
new OleDbDataAdapter(
commandString, connectionString);
DataSet DataSet = new DataSet();
DataAdapter.Fill(DataSet,"OutboundConfig");
// Get the one table from the DataSet
DataTable dataTable = DataSet.Tables[0];
DataRow dataRow = dataTable.Rows[0];
ServerName = Convert.ToString(dataRow["FaxServerName"]);
UserName = Convert.ToString(dataRow["FaxUserID"]);
Password = Convert.ToString(dataRow["FaxPassword"]);
UseNTAuthentication =
Convert.ToBoolean(dataRow["FaxUseNTAuthentication"]);
// Release resource
DataAdapter.Dispose();
i write the following code, but will the db resource be released?
i noted that at the SQL Server's Process Info that my application seems
generate lots of Process with new ProcessID, will it be removed if the
application runs Dispose() method.
or i better not to use Adapter
OleDbDataAdapter DataAdapter =
new OleDbDataAdapter(
commandString, connectionString);
DataSet DataSet = new DataSet();
DataAdapter.Fill(DataSet,"OutboundConfig");
// Get the one table from the DataSet
DataTable dataTable = DataSet.Tables[0];
DataRow dataRow = dataTable.Rows[0];
ServerName = Convert.ToString(dataRow["FaxServerName"]);
UserName = Convert.ToString(dataRow["FaxUserID"]);
Password = Convert.ToString(dataRow["FaxPassword"]);
UseNTAuthentication =
Convert.ToBoolean(dataRow["FaxUseNTAuthentication"]);
// Release resource
DataAdapter.Dispose();