MySQL Forums :: MySQL for Visual Studio :: Read using ExecuteScalar


Advanced Search

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
Read using ExecuteScalar 868 Gunnar Wallier 03/01/2016 08:23AM
Re: Read using ExecuteScalar 418 Luis Penunuri 03/08/2016 05:28PM
Re: Read using ExecuteScalar 430 Gunnar Wallier 03/09/2016 12:03AM
Re: Read using ExecuteScalar 407 Luis Penunuri 03/09/2016 10:54AM
Re: Read using ExecuteScalar 381 Gunnar Wallier 03/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.