using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Hospitalfinancialmanangement
{
public partial class frmBuyproduct : Form
{
AutoCompleteStringCollection productname = new AutoCompleteStringCollection();
public frmBuyproduct()
{
InitializeComponent();
}
DBOperation obj = new DBOperation();
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void frmBuyproduct_Load(object sender, EventArgs e)
{
try
{
string selQry = string.Empty;
selQry = "SELECT DISTINCT productname FROM tbl_Productentry";
DataTable dt = new DataTable();
dt = obj.getDatatable(selQry);
int rowcnt = 0;
rowcnt = dt.Rows.Count;
if (rowcnt > 0)
{
//for (int rowCount = 0;rowCount < rowcnt ; rowCount++)
// {
productname.Add(dt.Rows[0][0].ToString());
//}
}
else
{
MessageBox.Show("NOT FOUND");
}
txtProductname.AutoCompleteMode = AutoCompleteMode.Suggest;
txtProductname.AutoCompleteSource = AutoCompleteSource.CustomSource;
txtProductname.AutoCompleteCustomSource = productname;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}