TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prasanth R
NA
24
46.1k
binding datagrid with wpf
Oct 18 2013 2:24 AM
here is the code
private void button1_Click(object sender, RoutedEventArgs e)
{
DataTable dt = new DataTable();
string constring = "Data source=----------\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True;";
using (SqlConnection con = new SqlConnection(constring))
{
con.Open();
string cmdstring = "select * from emp";
using (SqlCommand cmd = new SqlCommand(cmdstring, con))
using (SqlDataAdapter adp = new SqlDataAdapter(cmd))
adp.Fill(dt);
}
grid_emp.ItemsSource = dt.DefaultView;
}
when clicking on button output is looking like this..
Reply
Answers (
4
)
Mdi windows in wpf
Modal dialog box on user control