如何将mysql数据库数据绑定到wpf文本框? [英] how to Bind mysql database data to wpf textbox ?

查看:222
本文介绍了如何将mysql数据库数据绑定到wpf文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我是WPF的新手.现在,我尝试将数据绑定到wpf文本框中.但我不知道如何编码.请帮助我.

我的代码.连接mysql.

private void button1_Click(object sender, RoutedEventArgs e)
        {
            string MyConString = "SERVER=192.168.1.100;" +
                "DATABASE=mcs_kiosk;" +
                "UID=root;" +
                "PASSWORD=;";
            MySqlConnection connection = new MySqlConnection(MyConString);
            MySqlCommand command = connection.CreateCommand();
            MySqlDataReader Reader;
            command.CommandText = "select * from mcs_User";
            connection.Open();
            Reader = command.ExecuteReader();        
           //textBox1.text = ? ;
            connection.Close();
        }



谢谢,

解决方案

请查看以下知识库文章:
http://msdn.microsoft.com/en-us/library/aa480226.aspx [ ^ ]

hello friends,

i am new to wpf,. now i try bind the data in wpf textbox,. but i dont know how to code it. pls help me,.

my code for,. connect mysql.

private void button1_Click(object sender, RoutedEventArgs e)
        {
            string MyConString = "SERVER=192.168.1.100;" +
                "DATABASE=mcs_kiosk;" +
                "UID=root;" +
                "PASSWORD=;";
            MySqlConnection connection = new MySqlConnection(MyConString);
            MySqlCommand command = connection.CreateCommand();
            MySqlDataReader Reader;
            command.CommandText = "select * from mcs_User";
            connection.Open();
            Reader = command.ExecuteReader();        
           //textBox1.text = ? ;
            connection.Close();
        }



thank u,.

解决方案

Please check the following KB article:
http://msdn.microsoft.com/en-us/library/aa480226.aspx[^]


这篇关于如何将mysql数据库数据绑定到wpf文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆