Add the following C# code to the click event handler between the { and } curly braces for the button's click event handler. string oradb ="Data Source=ORCL10g;User Id=scott;Password=tiger;"; OracleConnection conn =new OracleConnection(oradb); // C# conn.Open(); OracleCommand cmd =new OracleCommand(); cmd.Connection = conn; cmd.CommandText ="select user from user_users"; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); dr.Read(); label1.Text = dr.GetString(0); conn.Dispose();
posted on
2006-06-13 14:42Calaio
阅读(299)
评论(0)
编辑收藏举报