[Mono-bugs] [Bug 58406][Nor] Changed - SQLDataReader missing required method
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 20 May 2004 06:52:53 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by sumadevi@novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=58406
--- shadow/58406 2004-05-12 20:44:33.000000000 -0400
+++ shadow/58406.tmp.17886 2004-05-20 06:52:53.000000000 -0400
@@ -1,13 +1,13 @@
Bug#: 58406
Product: Mono: Class Libraries
Version: unspecified
OS: Red Hat 9.0
OS Details: RHEL 3.0
-Status: NEW
-Resolution:
+Status: RESOLVED
+Resolution: FIXED
Severity: Unknown
Priority: Normal
Component: Sys.Data.SqlClient
AssignedTo: sumadevi@novell.com
ReportedBy: edward.ellis@pnl.gov
QAContact: mono-bugs@ximian.com
@@ -42,6 +42,180 @@
Always
Additional Information:
------- Additional Comments From miguel@ximian.com 2004-05-12 20:44 -------
We are completing the APIs right now, am assigning this bug to Uma.
+
+------- Additional Comments From sumadevi@novell.com 2004-05-20 06:52 -------
+Fixed in today's checkin.
+Test code used is attached
+
+using System;
+
+using System.Data;
+
+using System.Data.SqlClient;
+
+
+
+namespace MonoTests.System.Data
+
+{
+
+ class SqlDataReaderTest
+
+ {
+
+ public static void Main(string[] args)
+
+ {
+
+ String connectionString = null;
+
+ SqlConnection con;
+
+ SqlCommand cmd;
+
+ SqlDataReader reader;
+
+
+
+ //Fill the conenction string for SQL Server
+
+ connectionString =
+
+ "Server=1.1.1.1;" +
+
+ "Database=NorthWind;" +
+
+ "User ID=sa;" +
+
+ "Password=novell";
+
+
+
+
+ con = new SqlConnection(connectionString);
+
+ Console.WriteLine ("Opening Connection...");
+
+ con.Open ();
+
+
+
+ Console.WriteLine ("Dropping Table...");
+
+ cmd = con.CreateCommand ();
+
+ string sql = "drop table test;";
+
+ cmd.CommandText = sql;
+
+ try
+
+ {
+
+ cmd.ExecuteNonQuery ();
+
+ }
+
+ catch
+
+ {
+
+ Console.WriteLine ();
+
+ }
+
+
+
+ Console.WriteLine ("Creating Table...");
+
+ cmd = con.CreateCommand ();
+
+ sql = "create table test(name varchar(30),id varchar(30));";
+
+ cmd.CommandText = sql;
+
+ cmd.ExecuteNonQuery ();
+
+
+
+ Console.WriteLine ("Selecting values...");
+
+ sql = "select * from test;";
+
+ cmd = new SqlCommand(sql,con);
+
+ reader = cmd.ExecuteReader();
+
+ Console.WriteLine ("Before Inserting Values- Has Rows:" +
+reader.HasRows);
+
+ reader.Close();
+
+
+
+ sql = "insert into test values('name1','001');";
+
+ cmd = con.CreateCommand ();
+
+ cmd.CommandText = sql;
+
+ cmd.ExecuteNonQuery ();
+
+
+
+ sql = "insert into test values('name2','002');";
+
+ cmd = con.CreateCommand ();
+
+ cmd.CommandText = sql;
+
+ cmd.ExecuteNonQuery ();
+
+
+
+
+
+ sql = "select * from test;";
+
+ cmd = new SqlCommand(sql,con);
+
+ reader = cmd.ExecuteReader();
+
+ Console.WriteLine ("After Inserting Values- Has Rows:" +
+reader.HasRows);
+
+
+
+ while (reader.Read())
+
+ {
+
+ Console.WriteLine(reader.GetString(0) + ", " + reader.GetString(1));
+
+ }
+
+ Console.WriteLine ("After Reading Values- Has Rows: " +
+reader.HasRows);
+
+ Console.WriteLine ("After Reading Values- Read: " + reader.Read());
+
+
+
+
+
+ con.Close();
+
+
+
+ }
+
+ }
+
+}
+
+
+
+