Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this code in winform application for retrieving data from sql server to fill textboxes

C#
daPattern.SelectCommand = new SqlCommand("SELECT * from Pattern", cs);
dsPattern.Clear();
daPattern.Fill(dsPattern);

PatternBS.DataSource = dsPattern.Tables[0];

ID.DataBindings.Clear();
ID.DataBindings.Add(new Binding("Text", PatternBS, "ID"));

ID is textbox that is binded to column ID in table Pattern, and I want to bind textbox in wpf code but DataBindings doesnt work there, so basically I just need help on hot to write code to bind textboxes in wpf
Posted
Updated 24-Aug-12 10:16am
v2

Sounds like fresher.Have a look on WPF Data Binding [^]
 
Share this answer
 
Comments
shonezi 24-Aug-12 2:52am    
problem is I know nothing about wpf, I know I know, I am just another fool trying to get something without basic knowledge of about it and it's frustrating to deal with those like me. but this xaml is totaly unknown to me for now, I just need the code for binding textbox to sql server table column and that's it.
Abhinav S 24-Aug-12 3:00am    
5!
WPF is different from Windows Forms in the sense that Data Binding on the UI side gains a lot of importance.

You can start with Data Binding (WPF)[^] to help you learn more about this topic.

Moving Toward WPF Data Binding One Step at a Time[^] is very useful to understand data binding.

A databinding overview[^] can also help you get started.
 
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