Displaying a description based on code in database
C#, database, WindowsApplication,
Hi everyone, i have a question how do i input the descriptions columns if i type the number based on my database in code columns, i already retrieve the code from database, but now i also want to display the description when the code shown too.
Here is the link for show you how is my retrieve the code from database:
"https://www.dropbox.com/s/it3z0bgnn4nmitv/Pictures.docx"
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();