Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
SqlCommand cmd = new SqlCommand("Select date from datetime", cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet(); 
Binding b = new Binding("Value", ds, "date", true);
datetimepicker1.DataBindings.Add(b);


Give an error " Cant bind or add properties 'date' to datasource"
Posted
Updated 1-Aug-12 5:53am
v2

1 solution

This is how to do binding programmatically :

Binding binding = new Binding("ActualWidth")
       {
         Source = this
       };
ParentSearchGrid.SetBinding(DataGrid.RowHeaderWidthProperty, binding);



In your case dataset does not have a property of type date, nor is it a dependency property.
 
Share this answer
 
v2

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