Hello everyone.I am new to vb.net 2008 and i am in trouble.The problem for me is that i am making a windows form for a company and i am in a mess in getting my database connection to my datagridview by clicking a button and my data should been shown in datagridview.pls give me suggestion about datasets and connection strings.and even i want to print the document.so pls help me out.
harsh01ajmera
0
Newbie Poster
Recommended Answers
Jump to Postwhat database you are using then?
Jump to Postcall this code on ur button click to display ur records in datagridview
'open connection Try Dim myCommand As New OleDbCommand With myCommand .CommandText = "SELECT * FROM tablename" .CommandType = CommandType.Text .Connection = Connection End With Dim dt As New DataTable dt.Load(myCommand.ExecuteReader) With DatagridView1 .AutoGenerateColumns = …
All 8 Replies
artemix22
4
Newbie Poster
artemix22
4
Newbie Poster
harsh01ajmera
0
Newbie Poster
poojavb
29
Junior Poster
harsh01ajmera
0
Newbie Poster
poojavb
29
Junior Poster
Mitja Bonca
557
Nearly a Posting Maven
poojavb
29
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.