Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

This is DataGird Bindg Code in WPF.

VB
Dim constr As String = Nothing
      Dim cn As New SqlConnection
      cn.ConnectionString = "Data Source=BASURAJ-PC;Initial Catalog=Raj;User ID=sa;Password=*******"
      Dim Query As String
      Query = "Select * from stud "
      Dim cmd As New SqlCommand(Query, cn)
      cmd.CommandType = CommandType.Text
      Dim sda As New SqlDataAdapter(cmd)
      Dim dt As New DataTable
      sda.Fill(dt)
      DataGrid1.ItemsSource = dt.AsDataView


In this code data shown in dt but when i am debug the application that time it shows the rows count in datagrid.
I am not getting the problem.

Give any solution.

Thank's in Advance...
Posted

1 solution

You might have forgotten to write AutoGenerateColumns = true property on your datagrid, else kindly share the XAML code of this !!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900