I have a data table with query inside, then i need to sent value of data table exactly in datagridview i made before. Anyone can do this?:-/
nore 0 Light Poster
Recommended Answers
Jump to PostDim objdatatable As DataTable = objDataSet.Tables("TableName") With DataGridView1 .AutoGenerateColumns = True .DataSource = objDataSet .DataMember = "TableName" ' Declare and set the alternating rows style... Dim objAlternatingCellStyle As New DataGridViewCellStyle() objAlternatingCellStyle.BackColor = Color.WhiteSmoke searchDataGridView.AlternatingRowsDefaultCellStyle = objAlternatingCellStyle End With
Jump to PostHello nore !
you can do like this , just take a bindingsource and use this codingSub MyGridData() dim mycon as new sqlConnection("your conn string") dim myDataTable as new DataTable myconn.open() Dim myDataAdapter as new SqlDataAdapter("your query ", mycon) myDataTable.table("MyTable").clear MyDataAdapter.fill(myDataTable,"MyTable") BindingSource1.datasource = myDataTable.table("MyTable") GataGridView.DataSource = …
All 8 Replies
aerohn 0 Newbie Poster
Netcode 33 Veteran Poster
nore 0 Light Poster
nore 0 Light Poster
M.Waqas Aslam 67 Posting Pro in Training Featured Poster
nore 0 Light Poster
pcs77 0 Newbie Poster
pcs77 0 Newbie 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.