Drag and down a combobox from toolbox and 3 text box for ID,name, and age. Make a function for getting database value (Name) in combobox and after click at any name then show all detail of that respected persion.
Click on combobox in write this code
{
string str = "server = MUNESH\\SQL2008R2;Database=datastore;UID=sa;Password=123;";
SqlConnection con = new SqlConnection(str);
string query = "select * from tablename where name = '"+combobox1.text+"' ";
SqlCommand cmd = new SqlCommand( query,con);
sqldatareader dbr;
try
{
con.open();
dbr = cmd.executereader();

Join the conversation! Your thoughts help the community grow.