MySQL Forums
Forum List  »  MySQL for Visual Studio

Re: Read using ExecuteScalar
Posted by: Gunnar Wallier
Date: March 09, 2016 12:03AM

Hi Luis,

Thanks for your reply.
My code looks like this:
Dim cpich As String
Dim Nikdb = New MySqlClient.MySqlConnection
Nikdb.ConnectionString = NikdbConn
Try
Nikdb.Open()
Using Nikdb
Using Mysq As New MySqlClient.MySqlCommand("SELECT cpichpower FROM ct WHERE cname LIKE '" + Cell + "%'", Nikdb)
Try
cpich = CType(Mysq.ExecuteScalar(), String)
Catch
cpich = "NIL"
End Try
End Using
End Using
Nikdb.Close()
Catch Ex As Exception
MessageBox.Show("Cannot read from database. Original error: " & Ex.Message)

/// Gunnar

Options: ReplyQuote


Subject
Views
Written By
Posted
910
March 01, 2016 08:23AM
458
March 08, 2016 05:28PM
Re: Read using ExecuteScalar
460
March 09, 2016 12:03AM
431
March 09, 2016 10:54AM
417
March 10, 2016 12:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.