Tag : .NET, Ms SQL Server 2008, Win (Windows App), VB.NET, VS 2008 (.NET 3.x), Windows
Date :
2013-01-25 11:00:57
By :
teera007
View :
885
Reply :
2
No. 1
Guest
Code (VB.NET)
btnsearch event click
conn.open
strsql = select [p_id],[p_name],[p_email],[p_address],[p_province],[p_tel] from tb_profile where [p_id] = txtsearch
dim dr as sqldataReader
dim cmd as sqlcommand
cmd = New SqlCommand(strsql, Conn)
dr = cmd.ExecuteReader()
if dr.read then
txtname.text = dr.getvalue(1).tostring
txtemil.text =dr.getvalue(2).tostring
txtaddress.text =dr.getvalue(3).tostring
txtprovince.text=dr.getvalue(4).tostring
txttel.text=dr.getvalue(5).tostring
else
MsgBox("ไม่พบข้อมูล",16,"ไม่พบข้อมูล")
end if
conn.close