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
Sulieman Alkatib
NA
56
4.6k
use DataSet and table Adapter
May 23 2017 4:59 AM
It's my first time to use dataset and table adapter. I'm trying to make insert , view all records and search for specific record in VB.
There is no errors but non of the buttons works
anyone have an idea how to make this work ?
also I wand the table to be refreshed every time I insert a record
Imports
System.Data.SqlClient
Public
Class
Form1
Private
Sub
Form1_Load(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
MyBase
.Load
Me
.Product_masterTableAdapter.Fill(
Me
.DBDataSet.Product_master)
InitializeComponent()
End
Sub
Private
Sub
Button3_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
'to search for record by product number
Dim
search
As
String
= TextBox1.Text
Try
Me
.Product_masterTableAdapter.FillBysearch(
Me
.DBDataSet.Product_master, search)
InitializeComponent()
Catch
End
Try
End
Sub
Private
Sub
Button4_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
'to display all records
Me
.Product_masterTableAdapter.Fill(
Me
.DBDataSet.Product_master)
InitializeComponent()
End
Sub
Private
Sub
Button1_Click(sender
As
Object
, e
As
EventArgs)
Handles
Button1.Click
Dim
pdt
As
Integer
Dim
desc
As
String
=
""
Dim
pro
As
Integer
Dim
uni
As
String
=
""
Dim
qty
As
Integer
Dim
rec
As
Integer
Dim
cos
As
Integer
Dim
sel
As
Integer
Me
.Product_masterTableAdapter.InsertQuery(pdt_no:=pdt, descr:=desc, profit_percent:=pro, uni_measure:=uni, qty_on_hand:=qty, recorder_level:=rec, cost_price:=cos, sell_price:=sel)
Label9.Text =
"Product inserted"
End
Sub
End
Class
Reply
Answers (
1
)
How to Set Footer IN RDLC reports in Window C#
How to license an Application in Winform