根据数据库中的代码显示描述 [英] Displaying a description based on code in database

查看:102
本文介绍了根据数据库中的代码显示描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据数据库中的代码显示描述

C#,数据库,WindowsApplication,





< a href =https://www.dropbox.com/s/it3z0bgnn4nmitv/Pictures.docx>这是链接,告诉我如何从数据库中检索代码



现在,我的问题是如果我在代码列中输入基于我的数据库的数字,我如何输入描述列?



By顺便说一句,我是会员10192100,有人提问显示基于代码的描述



因为我无法在那里添加解决方案,不知道为什么,所以我创建一个新问题。



这是我的代码,用于检索代码(0001,0002等)



Displaying a description based on code in database
C#, database, WindowsApplication,


Here is the link for show you how is my retrieve the code from database

Now, my question is how do i input the descriptions columns if i type the number based on my database in code columns?

By the way, i am Member 10192100, person who asked the question "Displaying a description based on code"

Because i cannot add solution to there, dunno why, so i create a new question.

Here is my code for retrieve the "code" (0001, 0002, and so on)

string connectionString = (@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\Archives\Projects\Program\Sell System\Sell System\App_Data\db1.accdb;Persist Security Info=False;");

OleDbDataReader dReader;
OleDbConnection conn = new OleDbConnection(connectionString);
            conn.Open();
            OleDbCommand cmd = new OleDbCommand("SELECT DISTINCT [Code] FROM [Data]", conn);
            dReader = cmd.ExecuteReader();
            AutoCompleteStringCollection codesCollection = new AutoCompleteStringCollection();

            while (dReader.Read())
            {
                string numString = "000" + dReader[0].ToString();
                codesCollection.Add(numString);
            }

            dReader.Close();
            conn.Close();

推荐答案

asdamd; ljlwjrqwjeoqiwopeiqpwoeiqopweiqopweipoqwiepoqwiajlskpoeiqopieopiwepodjalksdjlakiw
asdamd;ljlwjrqwjeoqiwopeiqpwoeiqopweiqopweipoqwiepoqwiajlskpoeiqopieopiwepodjalksdjlakiw


这篇关于根据数据库中的代码显示描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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