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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=77272 --- shadow/77272 2006-01-15 21:51:10.000000000 -0500 +++ shadow/77272.tmp.4456 2006-01-15 21:51:10.000000000 -0500 @@ -0,0 +1,86 @@ +Bug#: 77272 +Product: Mono: Class Libraries +Version: 1.1 +OS: All +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: Sys.Data.SqlClient +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: SqliteDataReader column names should be case-insensitive + +Description of Problem: +Looking up a value in a SqliteDataReader using the correct column name +should return a value, regardless of whether the column name specified has +the same case as the column definition. Most DataReaders for other +databases will do a case-sensitive search for the field, and if no field is +found, they will do a case-insensitive search. + +Steps to reproduce the problem: +1. Create and populate a sqlite database: +CREATE TABLE `FirstTable` ( + `FirstColumn` TEXT NULL default '' +); + +INSERT INTO FirstTable VALUES ('FirstTable FirstRow'); + +2. Create a C# program to access this database: +using System; +using System.Data; +using Mono.Data.SqliteClient; + +namespace AppX +{ + class X + { + static void Main(string[] args) + { + SqliteCommand cmd = new SqliteCommand(); + SqliteConnection connection = new +SqliteConnection(@"version=3,URI=file:C:\Temp\x.db"); + connection.Open(); + cmd.Connection = connection; + cmd.CommandText = "SELECT * FROM FirstTable;"; + cmd.CommandType = CommandType.Text; + + SqliteDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); + + while(dr.Read()) { + Console.WriteLine(dr["firstcolumn"].ToString()); + } + } + } +} + +3. Build x.cs: +mcs x.cs -r:Mono.Data.SqliteClient -r:System.Data + +4. Execute x.exe +mono x.exe + +Actual Results: +Unhandled Exception: System.NullReferenceException: Object reference not set to +an instance of an object. + at Mono.Data.SqliteClient.SqliteResultSet.get_Item(String name) + at Mono.Data.SqliteClient.SqliteDataReader.get_Item(String name) + at AppX.X.Main(String[] args) + +Expected Results: +FirstTable FirstRow + +How often does this happen? +Always + +Additional Information: +Changing: + Console.WriteLine(dr["firstcolumn"].ToString()); +To: + Console.WriteLine(dr["FirstColumn"].ToString()); +will execute correctly. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
