说我无法将类型System.Data.SqlClient.SqlDataReader
隐式转换为System.Data.SqlClient.SqlDataAdapter
:
答案 0 :(得分:0)
您的编译器是正确的。
将行替换为:
con.Open();
var adapter = new SqlDataAdapter(cmd);
itms.Load(adapter);
答案 1 :(得分:0)
您实际上打算使用SqlDataReader
而不是
SqlDataReader reader = cmd.ExecuteReader();
答案 2 :(得分:0)
您可以使用以下内容:
@Override
public void start(Future<Void> startFuture) throws Exception {
super.start(startFuture);
System.out.println("Referencing event bus");
// Reference to the event bus running on the JVM
EventBus eventBus = vertx.eventBus();
System.out.println("Creating HttpServer");
// Create HTTP Server to handle incoming requests
HttpServer httpServer = vertx.createHttpServer();
System.out.println("Creating Router");
// Create Router for routing to appropriate endpoint
Router router = Router.router(vertx);
System.out.println("Starting to consume message sent over event bus");
// Consume the incoming message over the address PING
eventBus.consumer("PING", event -> {
System.out.println("Received message: " + event.body());
event.reply("Received at PING address");
});
System.out.println("Receiver ready and receiving messages");
让我知道,如果有帮助的话:)