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.
Jump to Post
call 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 RepliesReply to this topic
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.