if u have SQL running on NT this code help you
in connecting with SQL server by passing some parameters Like Provider,User,Password etc.After established a successfull connection u can choose tables from the combobox and automatically all records will be shown in datagrid from selected table.