佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1488|回复: 2

VB.NET & MYSQL 问题

[复制链接]
发表于 31-12-2013 02:14 PM | 显示全部楼层 |阅读模式
VB.NET & MYSQL 问题

=========================================================

GENERAL DECLARATION
Imports MySql.Data.MySqlClient

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim cn As New MySqlConnection
        Dim cmd As New MySqlCommand
        Dim dr As MySqlDataReader

        cn.ConnectionString = " Server = localhost; user id = root; password = ; database = testdb; "
        cmd.Connection = cn
        cn.Open()
        cmd.CommandText = "SELECT UserID, UserPw from usermaster WHERE UserID ='" & TextBox1.Text & "' AND UserPw = '" & TextBox2.Text & "'"
        dr = cmd.EndExecuteReader '<== Error        1        Argument not specified for parameter 'result' of 'Public Function EndExecuteReader(result As System.IAsyncResult) As MySql.Data.MySqlClient.MySqlDataReader'.       

        If dr.HasRows Then
            MsgBox("OK")
        Else
            MsgBox("Invalid User ID OR Password!!!")

        End If
    End Sub




回复

使用道具 举报


ADVERTISEMENT

发表于 31-12-2013 07:15 PM | 显示全部楼层
。。。

虽然我不是很懂VB, 但是一看error message很直白啊, 就是你的function ‘cmd.EndExecuteReader ’ 少了argument。 你应该查查API document, 看这个function要怎样用。
回复

使用道具 举报

 楼主| 发表于 4-1-2014 11:03 PM | 显示全部楼层
fire-fly3 发表于 31-12-2013 07:15 PM
。。。

虽然我不是很懂VB, 但是一看error message很直白啊, 就是你的function ‘cmd.EndExecuteReader ...

解决了。。
谢谢你。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 12-9-2025 05:37 AM , Processed in 0.629648 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表