TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vincentkywan
NA
2
0
How to retrieve data from database and put it into text box...
Apr 19 2004 7:56 AM
Actually, I am doing about a search function. Users enter customer ID (which is auto number in Access file) and then find the customers, then show the details in the text box. However, I cannot do that because some reasons like references problem ...etc. ---Here is the code-- Public Class Customer Inherits System.Windows.Forms.Form Private connection As OleDbConnection Private command As OleDbCommand Private adapter As OleDbDataAdapter Private Sub btnM_Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnM_Search.Click connection.Open() Dim dt As New DataTable adapter = New OleDbDataAdapter(GetAll, connection) command.Connection = connection command.CommandText = "SELECT * FROM tblCustomer WHERE customer_ID = _ @customer_id " command.Parameters.Add("@customer_id", txtM_Item.Text) adapter.Fill(dt) txtM_CustomerID.DataBindings.Clear() txtM_CustomerName.DataBindings.Clear() txtM_phone.DataBindings.Clear() txtM_CustomerID.DataBindings.Add("Text", dt, "customer_ID") txtM_CustomerName.DataBindings.Add("Text", dt, "customer_name") txtM_phone.DataBindings.Add("Text", dt, "phone") connection.Close() End Sub --- end of code --- Thank you very much
Reply
Answers (
1
)
Create System DSN On The Fly
Dataset update doesn't work