![](https://lstatic.shangxueba.com/sxbzda/h5/images/m_q_title.png)
在C++程序中,可以使用命名空间,也可不使用命名空间。
![](https://lstatic.shangxueba.com/sxbzda/h5/images/tips_org.png)
第5题
【单选题】作为一名TestKing的软件开发人员,你正在创建一个在可更新DataGrid控件中给用户提供数据的ASP.NET应用程序。用户在网格中更新数据。你的代码使用System.Data命名空间和System.Data.OleDb命名空间。数据改变保存在ADO.NET DataTable对象中。你想当用户完成修改时用户的修改数据保存在数据库中,写了以下程序来完成任务: Public Shared Sub UpdateTestKData(_ ByVal sql As String,_ ByVal connectionString As String,_ ByVal dataTable As DataTable) Dim da As New OleDb.OleDbDataAdapter() Dim cnn As New OleDb.OleDbConnection(_ connectionString) dataTable.AcceptChanges() da.UpdateCommand.CommandText = sql da.UpdateCommand.Connection = cnn da.Update(dataTable) da.Dispose() End Sub 当用户编辑数据时,代码运行完成,但没有数据改变出现在数据库中。你测试代码中的更新查询和连接字符串,但都正常运行。你需要修改代码来确保数据更改在数据库中出现,该怎么做?
A、在调用Update方法之前添加以下两行代码: Dim cb As New OleDb. OleDbCommandBuilder(da) cd.GetUpdateCommand( )
B、在调用Update方法之前添加以下代码: da.GetUpdateCommand.Connection.Open( )
C、删除这行代码: dataTable.AcceptChanges( )
D、删除这行代码: da.Dispose( )
第6题
A.触发外部虚拟网络的虚拟DHCP服务器和运行ipconfig/renew命令,每个虚拟服务器上
B.在CKT的物理网络接口,激活的Internet连接共享(ICS)
C.使用Certkiller。COM的Intranet上CKT的所有虚拟服务器的IP地址。
D.添加并安装Microsoft环回适配器网络接口上CKT。使用新的网络接口,并创建一个新的虚拟网络。
E.以上都不是
第7题
【说明】
C++标准模板库中提供了vector模板类,可作为动态数组使用,并可容纳任意数据类型,其所属的命名空间为std。vector模板类的部分方法说明如下表所示:
【C++代码】
include <iostream>
include <vector>
using namespace (1);
typedef vector< (2) > INTVECTOR;
const int ARRAY_SIZE = 6;
void ShowVector (INTVECTOR &theVector);
int main() {
INTVECTOR theVector;
// 初始化 theVector, 将theVector的元素依次设置为0至5
for (int cEachItem = 0; cEachItem < ARRAY_SIZE; cEachItem++}
theVector.push_back((3));
ShowVector(theVector); // 依次输出theVector中的元素
theVector.erase (theVector.begin () + 3};
ShowVector(theVector);
}
void ShowVector (INTVECTOR &theVector) {
if (theVector.empty ()) {
cout << "theVector is empty." << endl; return;
}
INTVECTOR::iterator (4);
for (theIterator=theVector.begin(); theIterator !=theVector.end(); theIterator++) {
cout << *theIterator;
if (theIterator != theVector.end()-1) cout << ", ";
}
cout << end1;
}
该程序运行后的输出结果为:
0,1,2,3,4,5
(5)
第8题
A、System.Data.SqlClient
B、System.Data.OLEDB
C、System.Data.Odbc
D、System.Data.ADO
第9题
A、System.Data.SqlClient
B、System.Data.OLEDB
C、System.Data.Odbc
D、System.Data.ADO
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!