// definition database link object SqlConnection mycon = new SqlConnection (ConfigurationSettings.AppSettings [ "connstring"]); // connstring upper connection string SqlCommand mycmd = mycon.CreateCommand () is a database in web.config; mycmd.CommandText = " Open the statement of the database "; try {mycon.open (); sqldataareader mydr = mycmd.executeReader (); dataGrid.datasource = mydr; datagrid.database ();} finally {mycon.disponse (); // Turk database link}