how to bind data to griedview in windows app

Posted by Shanky11 under VB.NET on 3/2/2013 | Points: 10 | Views : 709 | Status : [Member] | Replies : 3
i have a griedview in splitcontrol
now i wants to fill this by below code why data is not binding to it even dataset is showing values of table only griedview not populating values in debugger mode i had chk after daataset filling statemetn grdviw.datasource showing nothing




Responses

Posted by: Jayakumars on: 3/2/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

shaky

post Your code
i solve them

Mark as Answer if its helpful to you

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shanky11 on: 3/2/2013 [Member] Starter | Points: 25

Up
0
Down
Public Sub fetchdetails()
sqlcon = New SqlConnection("data source=I3-001\SQL2008R2; initial catalog=SmsDb; user id=sa; password=bss123")
datset = New DataSet()
cmd1 = New SqlCommand("select * from Registration", sqlcon)
sqlda = New SqlDataAdapter(cmd1)
sqlda.Fill(datset)
DataGridView1.DataSource = datset


End Sub


Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/2/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

shaky use this check image i attached bind record in gridview

sqlda.Fill(ds) ;
dataGridView1.DataSource = ds.Tables[0].DefaultView;


Dont Forgot mark as answer if this useful.
 Download source file

Mark as Answer if its helpful to you

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response