Sabtu, 22 November 2014

MysqlDataReader VB.NET 2010

Mysql data reader adalah class yang disediakan oleh mysql untuk mengakses data dari database mysql
dengan mysql data reader anda dapat menampilkan data yang diinginkan melalui queri yang selanjutnya data tersebut di pasing ke dalam mysqldatareader berikut ini adalah contoh kode vb.net untuk implementasi pengambilan data melalui mysqldatareader.


Imports MySql.Data
Imports MySql.Data.MySqlClient
 
 
private sub_coba() 

Dim connect As New MySqlConnection("server=localhost;uid=root;database=ticketing_system;pwd=;")
dim dr as mysqldataadapter
connect.Open()

Dim sqlcmd As New MySqlCommand("SELECT * complaint WHERE tran_no='" & lbltranno.Text & "'")

dr = sqlcmd.ExecuteReader()
dr.read()
 
 txdata.text=dr(0)
 
dr.close
connect.Close()
end sub


jika data yang di tampilkan lebih dari satu baris maka tinggal tambahkan looping seperti berikut


while dr.read
listbox1.item.add dr(0)

end while

data tersebut akan ditampilkan pada listbox


demikian terimakasih semoga bermanfaat




1 komentar:

  1. Sometimes, you face difficulty in e-filing your tax returns after being rejected by the Internal Revenue Service. You have to follow a few tips to fix return rejections. Type the correct SSN that matches with your details on the tax form. Enter the accurate information of your family members for which you are going to the e-file tax return. Apply your tax return separately by emailing the IRS if your dependent has applied to the TurboTax e-file tax return facility. If there is any issue in putting these tips to troubleshoot rejection, then call Turbotax Technical Support Number

    Read More : How Do I Fix A Rejected Return On TurboTax
    Related Post : Fix TurboTax Error Code 65535 | Install TurboTax With or Without CD/DVD on Windows 10

    BalasHapus

how coffee can prevent cancer

Coffee and Cancer: An Examination of the Relationship   Coffee, one of the most consumed beverages worldwide, has been the subject of extens...