Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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)

C#
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();
Posted
Comments
Sergey Alexandrovich Kryukov 6-Aug-13 11:47am    
Please tag the type of your "Windows application" or the UI library you want to use. http://whathaveyoutried.com? What's the problem, exactly?
—SA
adriancs 6-Aug-13 13:24pm    
Why asking the same question twice?
http://www.codeproject.com/Questions/632607/Convert-int-to-string-and-read-it-in-csharp-window
I have already answered your question.
If you are not clear with the answers, you can post comments or questions under the answers provided.
Sergey Alexandrovich Kryukov 6-Aug-13 22:05pm    
You probably misplaced this comment. That was different inquirer with different question.
—SA
Fuhans 6-Aug-13 21:33pm    
Thanks @adriancs for your explanation in "Here", i appreciated it, but i have one more question "how do i input the descriptions columns if i type the number based on my database in code columns?" The reason why i posted the same question twice is because the last post which is "This", i cannot reply the question, the forum said that "Oops! There was an unexpected problem adding your answer. Please try again later.", even though i already tried many times, so i decided to make a new question. Sorry for that.

And Thanks for those who answered my question, i really appreciate that.

By the way, i am the person who asked the question on the top also in "Here"

1 solution

asdamd;ljlwjrqwjeoqiwopeiqpwoeiqopweiqopweipoqwiepoqwiajlskpoeiqopieopiwepodjalksdjlakiw
 
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