Where i made the mistake?
Dim mycon As MySqlConnection
Dim cmd As MySqlCommand
Dim rdr As MySqlDataReader
Dim cncls As ConnClass = New ConnClass
Dim cnt As Integer
Dim qry, ph As String
Call cncls.fndbmah()
mycon = cncls.mysqlconn
mycon.Open()
Try
cmd = New MySqlCommand("select count(*) as cnt from tblcust where id='" & ViewState("sel") & "'", mycon)
cnt = cmd.ExecuteScalar
If cnt = 1 Then
qry = "update tblcust set name='" & txtnm.Text & "',mobile='" & txtmb.Text & "',city='" & txtcity.Text & "',e_mail='" & txtemail.Text & "' where id='" & ViewState("sel") & "'"
Else
ph = Server.MapPath("./") & System.IO.Path.GetFileName(FileUpload1.FileName)
qry = "insert into tblcust(id,name,mobile,city,e_mail,photo) values('" & txtid.Text & "','" & txtnm.Text & "','" & txtmb.Text & "','" & txtcity.Text & "','" & txtemail.Text & "','" & ph & "')"
End If
cmd = New MySqlCommand(qry, mycon)
rdr = cmd.ExecuteNonQuery
Catch ex As Exception
MsgBox(Err.Description)
Finally
mycon.Close()
End Try
Error:
Compiler Error Message: BC30311: Value of type 'Integer' cannot be converted to 'MySql.Data.MySqlClient.MySqlDataReader'.
note: error indicating the line:
rdr = cmd.ExecuteNonQuery